Re: Strange behaviour with ksh under Linux

From: those who know me have no need of my name (not-a-real-address_at_usa.net)
Date: 05/31/03


Date: 31 May 2003 18:36:56 GMT

in comp.unix.shell i read:

> #! /bin/ksh
>
> if [ "a" = "a" ] && [ "b" = "b" ]
> then
> [ "c" != "c" ] && echo different1 # <= Test 1
> [ "" != "" ] && echo different2 # <= Test 2
> fi
> echo YES
>
>Now the command I am using with its result :
>> ksh -e This_file
>Notice that
>If I put one of the test (Test1 or Test2) in comment
>
>> ksh -e This_file
>YES

ksh isn't like sed or perl, you don't name the script to run by using a -e
option. the -e option tells ksh that if any command returns a non-zero
exit status (commonly held to be a failure) the script is aborted. try
your full script again without -e, i.e.,

  ksh This_file

-- 
bringing you boring signatures for 17 years