Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] mkdir and $?


On Fri, Jul 06, 2001 at 09:20:52PM +1000, Jeff Waugh wrote:
> This is annoying - if anyone knows why this is happening, please tell me.
> I'm only interested in the errno, not the error (which is not set with -p,
> as stated in the docs).
> 
> For some reason, testing if $? = 0 is always false, even if $? really ought
> to be true (ie. it's built all the directories and $ERROR = 0). Argh!

Are you meaning to test the string length of $? ?

Does this work for you?

if [ "$ERRNO" -ne 0 ]; then