05-16-2013
Quote:
Originally Posted by
Don Cragun
As I said before, the standards only specify the behavior of awk when its input files are text files. Text files have the following constraints:
- they do not contain NUL characters,
- they contain zero or more lines, and
- each line in the file is a string of no more than {LINE_MAX} bytes including a terminating <newline> character.
And I have seen awk implementations that ignore incomplete lines.
The wc utility, on the other hand, is defined to work on any file type; not just text files. If you look at the standards,
wc -l prints a count of <newline> characters found in a file; not the number of lines in a file.
If we want to be really anal and follow the strict definition of a text file, it may or may not contain a terminator (NL/CR/LF) at the end.
Awk might think differently of course.
--
OFFTOPIC: I'm amazed by how many pages of discussion a simple "cat *" command can generate.
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello -
I have a file that has the something like the following :
REM CREATE TABLE lots of text
REM table specifc creation text ;
REM ALTER TABLE lots of text
REM text specific to the the alter command
REM could be more lines of text;
What I need is to get all the lines for the ALTER... (2 Replies)
Discussion started by: Feliz
2 Replies
2. UNIX for Dummies Questions & Answers
My website has been hacked and i need to remove a lot of unique files with same content. The files have very similar code:
eval(base64_decodeHow do i find multiple/all the files with the above code and remove them?
Thanks. (10 Replies)
Discussion started by: Boris_yo
10 Replies
3. Shell Programming and Scripting
Hello Guys
I have a directory of xml files (almost 500 ) Now in each xml file 3 new attributes will be added which are in a different single file
Is there any way I can copy the whole content of single file at 6th line of all the files in the directory .
Thanks a lot!!! (7 Replies)
Discussion started by: Pratik4891
7 Replies
4. Shell Programming and Scripting
Hi Guys
I want to write a script which search mail with subject line and after that I want the mail content in a file
please help guys.
Thanks
Atul Singh (3 Replies)
Discussion started by: atul9806
3 Replies
5. UNIX Desktop Questions & Answers
I have a file called part1.pdb...contents are:
ATOM 1 N SER 1 -10.295 -8.909 10.913 1.00 0.00
ATOM 2 H1 SER 1 -10.230 -8.214 10.183 1.00 0.00
ATOM 3 H2 SER 1 -9.558 -8.745 11.584 1.00 0.00
ATOM 4 H3 SER 1 -11.255 ... (1 Reply)
Discussion started by: kanikasharma
1 Replies
6. Shell Programming and Scripting
Hi Gurus,
I need replace multiple files content.
the file name pattern likes currentfile_code_*
the content pattern in the file like text=value
I need replace the content as text=abcde
Thanks in advance (7 Replies)
Discussion started by: ken6503
7 Replies
7. Shell Programming and Scripting
I'm looking for a bash scrypt to copy some folders and some of the content to another location. I'm a teacher and very noobish with programming language anyway what I'm looking for , I have this director structure
Main director "Students" with subfolders "john";"daisy";"work" etc .. and some of... (2 Replies)
Discussion started by: brickleul
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)