HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Simple question for sed/awk/perl experts
Operating System - HP-UX
1837625
Members
3303
Online
110117
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2002 03:15 AM
12-18-2002 03:15 AM
Simple question for sed/awk/perl experts
Hello,
I am not a very good script programmer :(
Please help!
The following file should be modified:
...
/backup01/pfs/sy/frm/sy001oc0.fmb
/backup01/pfs/sy/frm/rf910oc0.fmb
/backup01/pfs/sy/frm/rf920oc0.fmb
/backup01/pfs/sy/frm/rf930oc0.fmb
/backup01/pfs/sy/frm/rf940oc0.fmb
/backup01/pfs/sy/frm/rf950oc0.fmb
/backup01/pfs/sy/frm/rf001oc0.fmb
/backup01/pfs/sy/frm/rf810oc0.fmb
...
to become:
...
f60gen /backup01/pfs/sy/frm/sy001oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf910oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf920oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf930oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf940oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf950oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf001oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf810oc0.fmb ops\$yd/yd@pfs Compile_All=YES
...
I have tried "sed" in my script:
cat myfile.log | sed s/\/backup01/f60gen \/backup01 > f1.log
cat f1.log | sed s/.fmb/.fmb ops\$yd/yd@pfs Compile_All=YES > myfile.log
and am getting the following error:
sed: Function s//backup01/f60gen cannot be parsed.
sed: Function s/.fmb/.fmb cannot be parsed.
Thanks a lot for all your replies
Best Regards
Yogeeraj
I am not a very good script programmer :(
Please help!
The following file should be modified:
...
/backup01/pfs/sy/frm/sy001oc0.fmb
/backup01/pfs/sy/frm/rf910oc0.fmb
/backup01/pfs/sy/frm/rf920oc0.fmb
/backup01/pfs/sy/frm/rf930oc0.fmb
/backup01/pfs/sy/frm/rf940oc0.fmb
/backup01/pfs/sy/frm/rf950oc0.fmb
/backup01/pfs/sy/frm/rf001oc0.fmb
/backup01/pfs/sy/frm/rf810oc0.fmb
...
to become:
...
f60gen /backup01/pfs/sy/frm/sy001oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf910oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf920oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf930oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf940oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf950oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf001oc0.fmb ops\$yd/yd@pfs Compile_All=YES
f60gen /backup01/pfs/sy/frm/rf810oc0.fmb ops\$yd/yd@pfs Compile_All=YES
...
I have tried "sed" in my script:
cat myfile.log | sed s/\/backup01/f60gen \/backup01 > f1.log
cat f1.log | sed s/.fmb/.fmb ops\$yd/yd@pfs Compile_All=YES > myfile.log
and am getting the following error:
sed: Function s//backup01/f60gen cannot be parsed.
sed: Function s/.fmb/.fmb cannot be parsed.
Thanks a lot for all your replies
Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2002 03:18 AM
12-18-2002 03:18 AM
Re: Simple question for sed/awk/perl experts
Please please please ignore this one!
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 10:27 AM
12-19-2002 10:27 AM
Re: Simple question for sed/awk/perl experts
Ooooops.
Didn't see your "ignore" ~%|
bv
Didn't see your "ignore" ~%|
bv
"The lyf so short, the craft so long to lerne." - Chaucer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 10:33 AM
12-19-2002 10:33 AM
Re: Simple question for sed/awk/perl experts
Well, you left off some quotes, reversed your substitution, and didn't know that you could do mulitple substitutions :).
This would work:
cat myfile.log | sed -e 's/^/f60gen /' -e 's/$/ ops\\$yd\/yd@pfs Compile_All=YES/'
as in:
# echo XXXXX | sed -e 's/^/f60gen /' -e 's/$/ ops\\$yd\/yd@pfs Compile_All=YES/'
f60gen XXXXX ops\$yd/yd@pfs Compile_All=YES
You could also use 'awk'.
bv
This would work:
cat myfile.log | sed -e 's/^/f60gen /' -e 's/$/ ops\\$yd\/yd@pfs Compile_All=YES/'
as in:
# echo XXXXX | sed -e 's/^/f60gen /' -e 's/$/ ops\\$yd\/yd@pfs Compile_All=YES/'
f60gen XXXXX ops\$yd/yd@pfs Compile_All=YES
You could also use 'awk'.
bv
"The lyf so short, the craft so long to lerne." - Chaucer
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP