dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Tests [ 0 -eq $UID ] don't work as in bash
@ 2016-09-07 14:44 Andrey Voropaev
  2016-09-07 15:55 ` Paul Smith
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Voropaev @ 2016-09-07 14:44 UTC (permalink / raw)
  To: dash

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-07 20:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07 14:44 Tests [ 0 -eq $UID ] don't work as in bash Andrey Voropaev
2016-09-07 15:55 ` Paul Smith
2016-09-07 20:02   ` Stephane Chazelas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).