Re: tcsh bug
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 09:49:49 -0400
In article <1159450277.151149.40600@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"blue" <singh.sundeep@xxxxxxxxx> wrote:
Hi,
Can someone explain this weird behaviour...
I have a script like this:
******************************************************************************
*******
#! /bin/tcsh -f
# tcsh 6.12.00
if (-e Hce.res) then
fgrep PASSED Hce.res >& /dev/null
if ($status)then
# If you put a space between "($status)" and "then" things work fine.
echo "Hce.res exists:: FAIL1: HCE "
else
echo "Hce.res exists:: PASS2: HCE Test"
endif
else
echo "Hce.res does NOT exist:: FAIL3: "
endif
******************************************************************************
*******
I am executing it on Red Hat Enterprise 3.0, Intel x86.
Even when the file "Hce.res" is absent, it prints "Hce.res exists::
PASS2: HCE Test".
The shell dosen't complain of any syntax error in script.
csh and tcsh are sometimes very picky about whitespace. One of many
reasons not to use them for scripting.
--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.
- References:
- tcsh bug
- From: blue
- tcsh bug
- Prev by Date: tcsh bug
- Next by Date: Re: tcsh bug
- Previous by thread: tcsh bug
- Next by thread: Re: tcsh bug
- Index(es):
Relevant Pages
|