HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script help-cut and append text
Operating System - HP-UX
1825782
Members
2134
Online
109687
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
Go to solution
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
08-22-2004 08:34 PM
08-22-2004 08:34 PM
I have a file with two columns (1st column fqdn and 2nd column IP address) of text separated by tabs.
I want to cut the second column, IP address’s.
And then append some text ( a string).
Can you suggest how I can start such a script?
Thanks.
I want to cut the second column, IP address’s.
And then append some text ( a string).
Can you suggest how I can start such a script?
Thanks.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2004 08:43 PM
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2004 08:47 PM
08-22-2004 08:47 PM
Re: script help-cut and append text
Hi
Simple way to play with fields
cat file|while read a b
> do
> echo $a "cccccccccc" $b
> done
For scripting see
http://www.shelldorado.com/
Steve Steel
Simple way to play with fields
cat file|while read a b
> do
> echo $a "cccccccccc" $b
> done
For scripting see
http://www.shelldorado.com/
Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
- Tags:
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2004 08:49 PM
08-22-2004 08:49 PM
Re: script help-cut and append text
Hi SM,
you can use for example the following script
cat|while read line
> do
> echo "`echo $line|awk '{print $2}'`" >> /tmp/
> done
This would add the IP ($2) and the new string (your_text) into the new created file
Regards
Franky
you can use for example the following script
cat
> do
> echo "`echo $line|awk '{print $2}'`
> done
This would add the IP ($2) and the new string (your_text) into the new created file
Regards
Franky
Don't worry be happy
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP