HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- perl in place edit question
Operating System - HP-UX
1833012
Members
3197
Online
110048
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
04-01-2003 05:39 AM
04-01-2003 05:39 AM
perl in place edit question
Hi
I am using the perl "in place edit" function
ie. perl -i -p -e's/string1/string2/g' filenam
is it possible to pass in a sed file - equivalent of sed -f with multiple search and replaces ?
Cannot see it in the help "stuff"
Cheers
Ian
I am using the perl "in place edit" function
ie. perl -i -p -e's/string1/string2/g' filenam
is it possible to pass in a sed file - equivalent of sed -f with multiple search and replaces ?
Cannot see it in the help "stuff"
Cheers
Ian
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2003 05:58 AM
04-01-2003 05:58 AM
Re: perl in place edit question
If you need more parsing to be done than what is comfortable on a single line just write a Perl script.
You may always invoke by separately calling for the perl with any number of switches.
Besides, you can separate single Perl statements by semicolons in your -e string.
Have a look at
perldoc perlrun
You may always invoke by separately calling for the perl with any number of switches.
Besides, you can separate single Perl statements by semicolons in your -e string.
Have a look at
perldoc perlrun
Madness, thy name is system administration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2003 06:17 AM
04-01-2003 06:17 AM
Re: perl in place edit question
Like this?
l1:/tmp 104 > cat xx.txt
abcdef
bcdefg
cdefgh
defghi
efghij
l1:/tmp 105 > cat xx.pl
#!/pro/bin/perl -pi
s/a/AHA/g;
tr/b/X/;
s/fg/GF/;
l1:/tmp 106 > perl xx.pl xx.txt
l1:/tmp 107 > cat xx.txt
AHAXcdef
XcdeGF
cdeGFh
deGFhi
eGFhij
l1:/tmp 108 >
Enjoy, have FUN! H.Merijn
l1:/tmp 104 > cat xx.txt
abcdef
bcdefg
cdefgh
defghi
efghij
l1:/tmp 105 > cat xx.pl
#!/pro/bin/perl -pi
s/a/AHA/g;
tr/b/X/;
s/fg/GF/;
l1:/tmp 106 > perl xx.pl xx.txt
l1:/tmp 107 > cat xx.txt
AHAXcdef
XcdeGF
cdeGFh
deGFhi
eGFhij
l1:/tmp 108 >
Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
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