Unexpected result from grep
From: Dan (daniel.j.botz_at_cummins.com)
Date: 12/11/03
- Next message: Chris F.A. Johnson: "Re: Unexpected result from grep"
- Previous message: Paul Pluzhnikov: "Re: attempt to link manually by invoking collect2; __ldr_data and __Argv unresolved"
- Next in thread: Chris F.A. Johnson: "Re: Unexpected result from grep"
- Reply: Chris F.A. Johnson: "Re: Unexpected result from grep"
- Reply: Jens Schweikhardt: "Re: Unexpected result from grep"
- Reply: Stephane CHAZELAS: "Re: Unexpected result from grep"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Dec 2003 08:13:13 -0800
Hello,
I can't seem to figure out why this isn't working. I'm running it on
Tru64 V5.1A with patch kit 5. I'm probably missing something obvious.
:-(
Here is my script:
/tmp # cat search
#!/usr/bin/ksh
set -x
typeset -r COMMAND='/sbin/grep'
typeset -r EXPRESSION="${1}"
typeset -r CHECK_FILE="${2}"
typeset RESULT=''
RESULT="$(${COMMAND} -E \'${EXPRESSION}\' ${CHECK_FILE} 2>/dev/null)"
print "RESULT: ${RESULT}"
Here is the test file:
/tmp # cat afile
rsh
Here is what happens when I run the script:
/tmp # search rsh afile
+ typeset -r COMMAND=/sbin/grep
+ typeset -r EXPRESSION=rsh
+ typeset -r CHECK_FILE=afile
+ typeset RESULT=
+ + /sbin/grep -E 'rsh' afile
+ 2> /dev/null
RESULT=
+ print RESULT:
RESULT:
Yet if I run the command at the command line, I get this:
/tmp # /sbin/grep -E 'rsh' afile
rsh
Thanks for your help!
Dan
- Next message: Chris F.A. Johnson: "Re: Unexpected result from grep"
- Previous message: Paul Pluzhnikov: "Re: attempt to link manually by invoking collect2; __ldr_data and __Argv unresolved"
- Next in thread: Chris F.A. Johnson: "Re: Unexpected result from grep"
- Reply: Chris F.A. Johnson: "Re: Unexpected result from grep"
- Reply: Jens Schweikhardt: "Re: Unexpected result from grep"
- Reply: Stephane CHAZELAS: "Re: Unexpected result from grep"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|