02-21-2005
What happened with AWK?
The second script seems not to work.
Quote:
266 lab2-19:~> cat directory
abs utah 12343
cde utah 230548
asf tar 2597
lasfj utah 2057
268 lab2-19:~> awk '$2~/utah/{print $2 ", " $1}' directory
utah, abs
utah, cde
utah, lasfj
270 lab2-19:~> cat new.awk
BEGIN {FS=" "}
{
$2~/utah/
{
print $2 ", " $1
}
}
271 lab2-19:~> awk -f new.awk directory
utah, abs
utah, cde
tar, asf
utah, lasfj
Last edited by endeavour1985; 02-21-2005 at 06:54 PM..
7 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
A few hours ago I made several reasonable posts to this forum and now they have dissapeared.
I read and followed the rules, and I sure didn't break any, but gone they are :(
I know I only joined the forum today, but do the posts have to be authorised or something?
... (14 Replies)
Discussion started by: cw1972
14 Replies
2. SuSE
I posted three specific queries relating to Suse earlier today but they've disappeared.
I originally incorrectly posted them in the Unix begiiners forum, edited them out from there and re-posted under Linux.
I'm guessing they've been mistaken for some kind of flood post as they have the same... (3 Replies)
Discussion started by: Mark Ward
3 Replies
3. What is on Your Mind?
:D anyone hear from ygor..?
haven't seen him post in a while... wonder what he is up to..!
the last i heard he was the D25khan.. that was him right guys ???
being a newbie myself that is one dude that i admire. him Norsk, Perdebro, RTM , Google and Zazzybob all real genius.. and the most... (2 Replies)
Discussion started by: moxxx68
2 Replies
4. UNIX for Dummies Questions & Answers
I've been using a mkisofs line like this for years without problem
# mkisofs -J -R -V 'Vol Label' -o /output/path/FILE.ISO /input/path/
Now, however, it gives a UTR-8 character message at the start
INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8... (0 Replies)
Discussion started by: Bobby
0 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have created a dosrename script and it was working fine unitl today. I can't think what i have changed (don't think i have to be honest). The error is when i run the script it says the file i am trying to rename does not exist when it blatently does.
Or is it a typo when i run the... (4 Replies)
Discussion started by: jazz8146
4 Replies
6. Solaris
what happened to admintool in Solaris10? (2 Replies)
Discussion started by: mndavies
2 Replies
7. What is on Your Mind?
I just found the website coolerbooks.com a couple weeks ago. It was a site that had loads of free ebooks for download.
But now it seems to have been hijacked by some Microsoft search thing.
There was an article last year claiming it teamed with Google (the anti-Microsoft!) to offer the... (2 Replies)
Discussion started by: KenJackson
2 Replies
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)