Visit Jeremy's Blog.
Go Back > Forums > Other *NIX Forums > AIX
User Name
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.


  Search this Thread
Old 06-01-2004, 03:31 PM   #1
LQ Newbie
Registered: Jun 2004
Location: Sao Paulo - Brazil
Posts: 1

Rep: Reputation: 0
Question 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
Old 06-01-2004, 04:17 PM   #2
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
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.
Old 06-07-2004, 11:47 AM   #3
Mark Taylor
Registered: Apr 2004
Posts: 60

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

Old 06-11-2004, 12:11 PM   #4
Registered: May 2002
Location: Toronto, ON, Canada
Distribution: Ubuntu, Debian, RedHat/CentOS
Posts: 624

Rep: Reputation: 31
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.
Old 07-01-2004, 01:32 PM   #5
LQ Newbie
Registered: Mar 2004
Location: France
Distribution: Slackware & RHEL 6.5
Posts: 7

Rep: Reputation: 0
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 !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
e0 will Rx, but not Tx...e1 works fine giant Linux - Networking 2 09-15-2004 02:13 PM
Everything works fine... but no ADSL!! Conexus Slackware 10 04-11-2004 07:29 AM
Works just fine...I think /home/kyle Linux - Software 0 03-10-2004 06:09 AM
'command not found' but works fine anyway HickorySlim Linux - General 11 08-03-2002 07:47 AM
Is wine works in AIX environment ??? gopi_20us Programming 0 03-01-2002 12:10 PM > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 10:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration