Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sed: 0602-404 Error

Status
Not open for further replies.

kobewins

Programmer
Dec 1, 2005
57
US
Hi,

I was trying to use the following sed commands:

sed '
1,2d
/^ *$/d
/spool/d
s/^ *//
s/ *$//
' $DESC_F > $FIELDS_F

Note:
1,2d # to delete Line# 1 and 2

But got the error as:
sed: 0602-404 Function 1,2d cannot be parsed.

Any help and hints are greatly appreciated.
 
Get rid of the trailing spaces in your sed script

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, PHV.

I have use AIX unix sed, feherke.
 
feherke, does GNU sed 4.0.5 admit this ?
sed '1,2d ' /path/to/input

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi

Of course. I think is just as normal, as indenting your code. You can use space or horizontal tab to improve your code's readability.
Code:
[blue]master #[/blue] seq 5 > sedtestfile

[blue]master #[/blue] sed '1,2d      ' sedtestfile
3
4
5

[blue]master #[/blue] sed $'  \t  1  \t  ,  \t  2  \t  d  \t  ' sedtestfile
3
4
5

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top