- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: awk,print
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
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
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
тАО07-31-2002 09:56 PM
тАО07-31-2002 09:56 PM
awk,print
how to pass an argument as below :
cat test.log|grep -v "*"|awk '{print '"TRY",$1"-"$2,">","/home/"$1".LOG".$3'}' > test1.log
I've got this error :
awk: The statement cannot be correctly parsed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:11 PM
тАО07-31-2002 10:11 PM
Re: awk,print
awk '{print '"TRY",$1"-"$2,">","/home/"$1".LOG."$3}'
Notice that I removed "'" before "}" and that I moved the "." before $3
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:16 PM
тАО07-31-2002 10:16 PM
Re: awk,print
awk '{print "TRY",$1"-"$2,">/home/"$1".LOG".$3}'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:30 PM
тАО07-31-2002 10:30 PM
Re: awk,print
Try this:
cat test.log|grep -v "*"|awk '{print '"TRY",$1"-"$2,">","/home/"$1".LOG",$3'}' > test1.log
*Note:
I put "," instead of "." - befor the last $3.
I hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 11:48 PM
тАО07-31-2002 11:48 PM
Re: awk,print
awk '{printf "TRY %s,%s > /home/%s.LOG.%s",$1,$2,$1,$3 }' >test1.log
..or something like it.
Your quoting of print goes wrong: print '"..."..".."' inside of body...
Regards,
Ceesjan