LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (http://www.linuxquestions.org/questions/aix-43/)
-   -   SED command doesn't works fine on AIX (http://www.linuxquestions.org/questions/aix-43/sed-command-doesnt-works-fine-on-aix-188523/)

JSnake 06-01-2004 02:31 PM

SED command doesn't works fine on AIX
 
Hi,

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.
ie.

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?

Thanks

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

Cheers
Mark

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 06:51 AM.