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


Relevant Pages

  • Re: Set -o Vi Causes core dump and segmentation fault
    ... set -o vi command and nothing happened. ... different from the parent shell's editor it causes this segmentation ... Our parent shell is bash and the editor is set (by /etc/ ... If you then spawn a ksh subshell,run set -o vi, ...
    (linux.redhat)
  • Re: Set -o Vi Causes core dump and segmentation fault
    ... some kernel changes are made. ... set -o vi command and nothing happened. ... different from the parent shell's editor it causes this segmentation ... If you then spawn a ksh subshell,run set -o vi, ...
    (linux.redhat)
  • Re: how to test if a file is more than one hour old in ksh
    ... old in ksh. ... I think 'find' command may be able to do that but I do not ... You could always use touch to touch a file with a back date - that's kind of kludgy. ... echo not older ...
    (comp.unix.shell)
  • Re: Set -o Vi Causes core dump and segmentation fault
    ... set -o vi command and nothing happened. ... After a day of divide and conquer on 18 scripts we have figured ... different from the parent shell's editor it causes this segmentation ... If you then spawn a ksh subshell,run set -o vi, ...
    (linux.redhat)
  • Re: setting set -x for just one command
    ... :> 'exec' is badif you use it in the middle of a script! ... in ksh it is redundant as the last command of a subshell since ...
    (comp.unix.shell)