Tests [ 0 -eq $UID ] don't work as in bash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

I'm sorry if this is FAQ question, but googling didn't report it, so
I'm asking here.

In our scripts we often use constructs like

##############
if [ 0 -eq $UID ]
then
        echo "This script must not be run by root user!"
        exit 1
fi
#################

This works fine in bash, but dash fails with warning " [: -ne:
argument expected". Is this intended feature? How to work around it in
dash then?

Best regards
Andrei Voropaev
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux