nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

SED pass a output line to another

This is a discussion on SED pass a output line to another within the Shell scripting forums, part of the Development/Scripting category; Iam new her I have a line "acadc_dri_DC.c", line 237: [F108] 'LastPwmM' undefined and i like it to be acadc_dri_DC.c(237): ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 10-13-2006, 05:13 PM
Junior Member
 
Join Date: Oct 2006
Posts: 4
Rep Power: 0
cillo
Default SED pass a output line to another


Iam new her
I have a line "acadc_dri_DC.c", line 237: [F108] 'LastPwmM' undefined
and i like it to be acadc_dri_DC.c(237): error [F108]: 'LastPwmM' undefined

But i newer used sed so wat to do.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-14-2006, 02:12 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

How many lines do you have? You can replace single line with something as follows:

Code:
echo \"acadc_dri_DC.c\", line 237: [F108] \'LastPwmM\' undefined | sed 's/\"//g'
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 10-16-2006, 12:28 PM
Junior Member
 
Join Date: Oct 2006
Posts: 4
Rep Power: 0
cillo
Default

It is a compiler output so i can be menny and the text can change but it will
look mor ore les the same.
Reply With Quote
  #4 (permalink)  
Old 10-18-2006, 04:06 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Well it is not diff task but it need some understanding

Code:
echo "acadc_dri_DC.c", line 237: [F108] 'LastPwmM' undefined | sed 's/"//g' | sed 's/,//'  |sed 's/line/(/g' | sed 's/:/):/' | sed 's/:/: error/' | sed 's/\]/\]:/'
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #5 (permalink)  
Old 10-18-2006, 02:40 PM
Junior Member
 
Join Date: Oct 2006
Posts: 4
Rep Power: 0
cillo
Default

Tangs.
But....
my command ar @timake.exe %1 %2 %3 %4 %5 %6 2>&1| sed "s/"//g" | sed "s/,//" | sed "s/line/(/g" | sed "s/:/):/" | sed "s/:/: error/" | sed "s/\]/\]:/"
And iam using GNU sed version 4.0.7 and WinXP Pro
I replased sed 's/"//g" with sed "s/"//g" else i get sed: -e expression #1, char 1: Unknown command: `''
And the i get sed: -e expression #1, char 7: Unknown option to `s'

As I understand "s/"//g" surge alle " and replase the with blank? and so on.
Reply With Quote
  #6 (permalink)  
Old 10-20-2006, 01:22 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Well I have tested it on my UNIX box and it is working fine. I dunoo what's wrong with Win XP sed command. Never used sed on XP.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #7 (permalink)  
Old 11-01-2006, 02:59 PM
Junior Member
 
Join Date: Oct 2006
Posts: 4
Rep Power: 0
cillo
Default

Thangs
this work sed -e "s/\"//g" -e "s/,//" -e "s/,//" -e "s/line /(/g" -e "s/:/):/" -e "s/:/: error/" -e "s/\]/\]:/"
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
HPUX Unix comparing 2 large files line by line raj HP-UX 1 02-11-2008 06:20 PM
Omit the first line in a file c341 Shell scripting 4 12-29-2006 03:07 PM
user pass word sparky Shell scripting 1 06-26-2006 08:19 PM
How to pass shell variable to awk program Shell scripting 4 06-23-2006 06:11 AM
for do loop in solaris one line Solaris/OpenSolaris 1 01-09-2006 02:35 PM


All times are GMT +5.5. The time now is 09:08 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36