-   AIX (
-   -   SED command doesn't works fine on AIX (

JSnake 06-01-2004 02:31 PM

SED command doesn't works fine on AIX

I've been developed a script shell on Linux 7.2 enviroment.
This script uses SED to "parse" a string returned by db2 call command.

DB2_STATUS=`db2 "call dbo.sp_test(?,?,?)"`
RESULT_STATUS=`echo $DB2_STATUS | sed -f myregexp.rxp`

myregexp.rxp file contents:

s/^STATUS: \([^"]*\).*$/\1/g
s/^\(.*\) $/\1/

In Linux, or Windows CygWin, this shell runs fine.
When I put this shell on AIX enviroment, I received a strange message:

"cannot parse.tion" or anything like that.

Someone could please help me to put this shell works properly?


Luiz Almeida

iainr 06-01-2004 03:17 PM

If you can post the value of the DB2_STATUS variable, I (or someone else) can test it for you and see why it isn't working.

Mark Taylor 06-07-2004 10:47 AM

give some example output and what you want to achieve by running it with the sed command


sewer_monkey 06-11-2004 11:11 AM

Is this the GNU version of sed by any chance? Many commercial UNIXes ship with broken tools, and almost all commerctial UNIX sysadmins replace them with their GNU equivalents. ;)

stany001 07-01-2004 12:32 PM

In your regexp file you need to protect all "strange" characters like ^ by an backslash ! You need to put it before the "not allowed" characters, in bash you may put them after !

All times are GMT -5. The time now is 12:14 AM.