- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- add a line with sed
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
Discussions
Discussions
Discussions
Forums
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
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
тАО08-01-2002 12:45 AM
тАО08-01-2002 12:45 AM
add a line with sed
commands) in the middle of a file after
a specific word using sed.
example : this is a file
whitch will
be added
I would like to add a line after 'will'
whitch include the line 'sometimes'
so it would become:
this is a file
whitch will
sometimes
be added
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 12:52 AM
тАО08-01-2002 12:52 AM
Re: add a line with sed
~~~~~~~~~~~~~~~~~~start~~~~~~~~~~~~~~~~~~
/will/ asometimes
~~~~~~~~~~~~~~~~~~~end~~~~~~~~~~~~~~~~~~~
Then, run the command:
sed -f append.cmd target.file > output.file
The output.file will contains what you want.
Regards,
Kenneth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 12:56 AM
тАО08-01-2002 12:56 AM
Re: add a line with sed
Regards,
Kenneth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 02:46 AM
тАО08-01-2002 02:46 AM
Re: add a line with sed
but is it also possible to add more words at once and save it in the same file
regards Rene
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 03:41 AM
тАО08-01-2002 03:41 AM
Re: add a line with sed
See if the following thread helps:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x611f4b3ef09fd611abdb0090277a778c,00.html
Basically, you can just use >>'s to append to the file until it's constructed appropriately.
Cheers!
James
If it's hard, you're doing it wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2002 10:59 AM
тАО08-01-2002 10:59 AM
Re: add a line with sed
s/old word/new word to be replaced/' file >newfile
mv newfile file
"\" is followed by newline
HTH
AR