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
09-10-2002 06:00 AM
09-10-2002 06:00 AM
awk help
cat access.idx|grep ^"2.$COUNTRY."|awk -F"." '{ print $3 }'|sort|uniq -c|awk '{ print "2."$COUNTRY"."$2".*\t"$1 }'
the following error output is displayed:
awk: Field $() is not correct.
The input line number is 1.
The source line number is 1.
I'm trying with "awk -v" argument, but I can not achieve a successfully result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 06:15 AM
09-10-2002 06:15 AM
Re: awk help
I have resolved this by:
cat access.idx|grep ^"2.$COUNTRY."|awk -F"." '{ print $3 }'|sort|uniq -c|awk -v CO=$COUNTRY '{ print "2."CO"."$2".*\t"$1 }'
Thanks anyway
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 06:17 AM
09-10-2002 06:17 AM
Re: awk help
# perl -ne's/^2\.$ENV{COUNTRY}\.// and print' access.idx | sort -u | sed "s/^/2.$COUNTRY/'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 06:31 AM
09-10-2002 06:31 AM
Re: awk help
cat access.idx|grep ^"2.$COUNTRY."|awk -F"." '{ print $3 }'|sort|uniq -c|awk x=$COUNTRY '{print "2."x"."$2".*\t"$1 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 06:32 AM
09-10-2002 06:32 AM
Re: awk help
awk '{ print "2."$COUNTRY"."$2".*\t"$1 }'
uses single quotes around the scriplet, causing $COUNTRY not to be evaluated as value, but as literal '$COUNTRY', something very unlikely to appear in your access.idx :)
awk '{ print "2."'$COUNTRY'"."$2".*\t"$1 }'
would have done the job to (see the single quotes around $COUNTRY)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 06:35 AM
09-10-2002 06:35 AM
Re: awk help
'{hello=system("echo $COUNTRY"); printf("2. %s.%s.%s",hello,$2,$1); }'
live free or die
harry