- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- awk problem
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
тАО11-22-2005 07:21 AM
тАО11-22-2005 07:21 AM
awk problem
awk '/abc|cde/ END{ print "--->" $1}' file
awk: cmd. line:1: /abc|cde/ END{ print "--->" $1}
awk: cmd. line:1: ^ parse error
I got parse error...why?
hmmm..
thank u
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:34 AM
тАО11-22-2005 07:34 AM
Re: awk problem
This works for me as written (and I cut-and-pasted from this post).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:38 AM
тАО11-22-2005 07:38 AM
Re: awk problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:39 AM
тАО11-22-2005 07:39 AM
Re: awk problem
Could you have an unprintable character in the command?
Rod Hills
- Tags:
- unprintable chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:40 AM
тАО11-22-2005 07:40 AM
Re: awk problem
Enter "alias" and look to see if awk is defined.
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:41 AM
тАО11-22-2005 07:41 AM
Re: awk problem
very change.....
I am using linux system, does it matter?
awk is just awk right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:44 AM
тАО11-22-2005 07:44 AM
Re: awk problem
The history of awk includes a version called "new awk" or "nawk", then you have the gnu version.
Although your line is very simple and should be runable. Try replacing the "--->" with just "###". In case the ">" is being processed by awk for file redirection.
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:46 AM
тАО11-22-2005 07:46 AM
Re: awk problem
Well, 'awk' is 'awk' just like UNIX is UNIX. There *ARE* variations. You might see if you have a "new" awk --- 'nawk'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:47 AM
тАО11-22-2005 07:47 AM
Re: awk problem
I suspect that if you remove the 'END' your script will run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 07:54 AM
тАО11-22-2005 07:54 AM
Re: awk problem
gawk '/abc|cde/ END { OFS=":", print "**" $1}' file
thank you for trying...
maybe gnu awk works funny..