Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk file manipulation

Status
Not open for further replies.

rogers42

Technical User
Mar 30, 2007
64
CA
Hi,

I am new to awk and had the following questions w.r.t file manipulation

1, How do I read multiple files and search for common records (in the two or more files) ?

2, How can I exectue an awk utility with out having to specify an input file name at the command line ?

Thanks in advance.

rogers42
 
Hi

Code:
[blue]master #[/blue] mawk -W version
mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan
[gray]( ... )[/gray]

[blue]master #[/blue] gawk -W version
GNU Awk 3.1.1
Copyright (C) 1989, 1991-2002 Free Software Foundation.
[gray]( ... )[/gray]

Feherke.
 
None of the various versions on Solaris 8 seem to be capable of reporting their versions, however they all produce slightly different usage messages:

[tt]# /usr/bin/awk
awk: Usage: awk [-Fc] [-f source | 'cmds'] [files]
# /usr/bin/nawk
Usage: /usr/bin/nawk [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]
# /usr/xpg4/bin/awk
Usage: awk [-F ERE] [-v var=val] 'program' [var=val ...] [file ...]
awk [-F ERE] -f progfile ... [-v var=val] [var=val ...] [file ...][/tt]

I find I always have to use nawk or the XPG4 version though because awk is very basic. It's one of my pet hates, I see no reason why they couldn't just update it since the newer versions (should) have a superset of the old awk functionality.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top