sed -r problem in AIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed -r problem in AIX
# 1  
Old 09-03-2007
sed -r problem in AIX

Hi All,

I have one doubt in the AIX. I executed the below command in the LINUX but i could not execute same thing in the AIX. Please see the details of my issue in below.

[root@vcswin3 ~]# cat test
line 1 (one)
line 2 (two)
build=test
line 3 (three)

[root@vcswin3 ~]# sed -r 's/build=\w+/build=new_build/' test
line 1 (one)
line 2 (two)
build=new_build
line 3 (three)

I want execute the same above sed command in the AIX, but its throwing error like sed -r is illegal object. so please anybody tell me what is the related command in the AIX. so that i'll execute my issue in the AIX.

Thanks in Advance.... please help me ASAP.....


Regards,
Sridhar
# 2  
Old 09-03-2007
Quote:
Originally Posted by sridhusha
I have one doubt in the AIX. I executed the below command in the LINUX but i could not execute same thing in the AIX. Please see the details of my issue in below.
...
[root@vcswin3 ~]# sed -r 's/build=\w+/build=new_build/' test
...
I want execute the same above sed command in the AIX, but its throwing error like sed -r is illegal object. so please anybody tell me what is the related command in the AIX. so that i'll execute my issue in the AIX.

The -r option is not standard. You should read your system's man page for sed to see whether it has any support for extended regexps.

Better still would be to use a basic regexp:
Code:
sed 's/build=.*/build=new_build/' test

# 3  
Old 09-04-2007
Normal sed also not working. Please give me any other way
# 4  
Old 09-04-2007
Quote:
Originally Posted by sridhusha
Normal sed also not working. Please give me any other way
Could you care to explain what is not working ? What did you try and what output did you get ?
# 5  
Old 09-11-2007
sed -r problem in AIX

I tried with following command also, still its not working in AIX Box.

sed 's/build=.*/build=new_build/' test

Please help me some body ASAP on this command.

Thanks,
Sridhar.
# 6  
Old 09-30-2007
sed -r problem in AIX

Come on guys ! no body is there to solve this ISSUE?
Please help me ASAP. I need this one very urjunt...........



Thnks in Advance.....

Regards,
Sridhar.
# 7  
Old 09-30-2007
See vino's post below. Also do not bump up posts as this is against the forum rules.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

AIX sed use space as delimiter

I am trying to do this with one small tweak. I would also like to use a space as a delimiter. sed 's/ */\ /g' file This is what my file looks like. server1, server2, server3 server4 server5 server6 I would like it to look like this. server1 server2 server3 server4 ... (6 Replies)
Discussion started by: cokedude
6 Replies

2. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

3. Shell Programming and Scripting

Find / sed on lnx/AIX/sun

Hello @all first of all in the best case this script has to work on every os (lnx/aix/sun). It's very simple what it should do. I have a standard path and I'll call it for this example /myhome/scripts Within this path there are more files and folders and some of them are tagged with... (4 Replies)
Discussion started by: Miniqpa
4 Replies

4. Shell Programming and Scripting

AIX sed/awk

I'm trying to change the pam.conf file like below. ssh auth required /usr/lib/security/pam_prohibit ssh account required /usr/lib/security/pam_prohibit emagent auth required /usr/lib/security/pam_prohibit emagent account required ... (4 Replies)
Discussion started by: pjeedu2247
4 Replies

5. Shell Programming and Scripting

Alternate for sed -i in AIX

Experts, At the moment I am working in AIX box where sed -i is not available. My requirement is as below Two files file1 and file2. file1 contains the IP address, its count. file2 contains the Hostname and its corresponding IP address. I would like get the IP address replaced with the apt... (7 Replies)
Discussion started by: sathyaonnuix
7 Replies

6. UNIX for Dummies Questions & Answers

Unable to run Sed in AIX

Hi All, I've wrote a script to truncate newline characters in a text file. Could you please help me in figuring out the issue :confused: for file in $Filelist; do echo $file; FileName=`basename $file`; sed 's/^M//g' $file> "${file}"2; mv "${file}"2 "${file}"; sed '1d' "${file}"... (5 Replies)
Discussion started by: udayakumar
5 Replies

7. Shell Programming and Scripting

SED on AIX Limitation

Hello, I have a problem running a script created in ksh for Linux (Tested on Debian 5.0, Ubuntu Server 10.04 and RHEL 5.1), it works properly. :b: I trying to pass it to a AIX 5.3. :wall: The problem is the character limit of 256 on a command system and SED. I need to cut the contents of... (8 Replies)
Discussion started by: nemesis.spa
8 Replies

8. AIX

AIX OS problem? network problem?

Dear ALL. I installed AIX OS on customer sites. but Only one site is too slow when I connected telnet, ftp.. Ping is too fast. but telnet and FTP is not connected.. of course i check the configuration file on aix but it's normal. Do any Idea?? thanks in advance. - Jun - (3 Replies)
Discussion started by: Jeon Jun Seok
3 Replies

9. Shell Programming and Scripting

AIX Korn shell sed -s problem

In a Korn shell script I have, cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt The header is short {{Company flag1}} But the result in header.txt is {{Company $cnumb}} The value of $cnumb is 120. I am trying to get the value of $cnumb into the header. I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies

10. UNIX for Dummies Questions & Answers

removing semicolon using sed in aix--urgent

hi I have an expression aaabbb; xxx xxxi i need to get the ouput as xxx xxxi i am using sed -e 's/\(*;\)//g' but it is not working..?? can some one suggest.. This is urgent (9 Replies)
Discussion started by: aixjadoo
9 Replies
Login or Register to Ask a Question