- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: help script
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
05-19-2006 06:55 AM
05-19-2006 06:55 AM
help script
file: test
cat test
pro=
xxxx
xxxx
base:
I need add in pro= the contains of file: test2
cat test2
pp.pp@pp.com
...
and add in base: the contains of file :test3
cat test3
pp.ogt@ko.com
...
script :
fo i in `test1`
do
cat test |sed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 07:35 AM
05-19-2006 07:35 AM
Re: help script
perl -n -e 'BEGIN{@test2=`cat test2`;@test3=`cat test3`}{if (/^pro=/) { print @test2;} elsif (/^base:/) { print @test3;} else { print $_}}' test >newtest
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 10:26 AM
05-19-2006 10:26 AM
Re: help script
ex -s test <
/^base:/r !cat test3
wq
EOF
and output of the above construct is...
cat test
pro=
pp.pp@pp.com
xxxx
xxxx
base:
pp.ogt@ko.com
hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 02:00 AM
05-23-2006 02:00 AM
Re: help script
cat test
pro=xxx
base=pp.ogt@ko.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 02:17 AM
05-23-2006 02:17 AM
Re: help script
I thought you wanted pro= to have the contents of file test2 which you show as pp.pp@pp.com.
Your description of the problem is a little unclear.
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 04:19 AM
05-23-2006 04:19 AM
Re: help script
Could you please provide a sample of how the input looks like and how the output should look like.
cat test
pro=xxx
base=pp.ogt@ko.com
this does not show where the contents of file test2 have been added to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2006 09:54 AM
06-14-2006 09:54 AM
Re: help script
cat test
pro=mail@test.com
base:mail2@test567.com
the field pro=
base:
is variable