- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: awk - too many fields
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
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
тАО12-18-2002 03:08 AM
тАО12-18-2002 03:08 AM
I have a file with lines formated like so:
OPTION:uname1:uname2:uname3:etc........
What I want to do is add a new username to the end of a specific line within a script. My idea was something along the lines of (don't worry syntax isn't 100% as this is off the top of my head)
awk -F: '{if ( $1 == OPTION) { sub($0,$0:uname4) }; print $0 }'
In other words if the 1st field is the one I'm looking for add the username to the end of the line. The problem I have is I get the following error:
awk: Line uname1:uname2:uname3 cannot have more than 199 fields.
Is there a way round this??
Thanks,
Ton
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 03:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 03:21 AM
тАО12-18-2002 03:21 AM
Re: awk - too many fields
awk can only support up to 199 fields.
Sorry, no other idear ;-(
Regards,
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 03:30 AM
тАО12-18-2002 03:30 AM
Re: awk - too many fields
Regards,
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 04:39 AM
тАО12-18-2002 04:39 AM
Re: awk - too many fields
you need perl (of course), but not for this task:
awk '/^OPTION/ {printf("%s:uname4\n",$0)}'
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 04:53 AM
тАО12-18-2002 04:53 AM