- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- How i can edit various files at same time?
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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-22-2005 10:06 PM
12-22-2005 10:06 PM
i have in my HP-UX 39 files(aprox. 18 mb ) that i'm do it to edit for changing the string: /*+ RULE */ for a space.
How i can do it at the same time with a loop?
Thenks.
best regards.
Francesco
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 10:31 PM
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 10:36 PM
12-22-2005 10:36 PM
Re: How i can edit various files at same time?
you can use commands that Pete suggest but
better
for FILE in `cat file_list`
do
sed 's|/*+ RULE */||g'` $FILE
done
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 10:52 PM
12-22-2005 10:52 PM
Re: How i can edit various files at same time?
you can try this (last version ;-))
for FILE in `cat file_list`
do
sed "s/\/\*+ RULE \*\///" $FILE > $FILE
done
(please test before use it because
sed statement result is redirect
on original file)
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 10:54 PM
12-22-2005 10:54 PM
Re: How i can edit various files at same time?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 11:11 PM
12-22-2005 11:11 PM
Re: How i can edit various files at same time?
No problem Pat, thank you for "begin the shell
script"!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2005 11:54 PM
12-22-2005 11:54 PM
Re: How i can edit various files at same time?
Either user $FILE > $FILE.tmp then mv $FILE.tmp to $FILE, or use ed: -
for FILE in *
do
ed $FILE <
w
q
EOF
done
- Tags:
- ed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2005 12:47 AM
12-23-2005 12:47 AM
Re: How i can edit various files at same time?
thanx Simon , it's my fault (don't test shell
script).
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2005 03:30 AM
12-23-2005 03:30 AM
Re: How i can edit various files at same time?
perl -p -i -e 's{/\*\+ RULE \*/}{ }g' *
This will edit each file in-place (-i option).
HTH
-- Rod Hills
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2005 07:14 PM
12-25-2005 07:14 PM
Re: How i can edit various files at same time?
thanks to all !