On Fri, Feb 5, 2016 at 12:02 PM, Bill Woodger <[email protected]>
wrote:

> awk can do everything itself. grep can take a (single) file as input. No
> *nix-person is going to do cat of one file into grep and then into awk. cat
> of two files would be good, (concatenation in the JCL) and that would be
> fine input for grep, but then head, or tail, or something else like that.
>
> If you use an example something they wouldn't use, it won't have the same
> bite.
>

​The OP's UNIX/Linux team could be nominated for the "useless use of cat"
award, I guess. ​I'm amazed by the number of times I've seen people "cat" a
file which they then pipe into the next command. E.g. "cat file.txt | od
-tcx1" instead of "od -tcx1 <file.txt". The only time I've seen cat used
reasonably (by my standards) is when the command in a pipe line can be
specified as a parameter to a script, or is based on an extension.

E.g.

case ${file} in
*.gz) command="zcat" ;;
*.bz2) command="bzcat" ;;
*.Z) command="uncompress -c" ;;
*.xz) command=xzcat ;;
*) command=cat ;;
​esac
${command} ${file} | some-other-command​



>
> On Friday, 5 February 2016 16:41:08 UTC, Tom Brennan  wrote:
> > I used cat/grep/awk because I saw it used so often by people in the
> > unix/linux team I used to work with.  Maybe it was just a quirk of that
> > group, or like our JCL where once someone codes it everyone else copies
> it.
> >
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
Werner Heisenberg is driving down the autobahn. A police officer pulls
him over. The officer says, "Excuse me, sir, do you know how fast you
were going?"
"No," replies Dr. Heisenberg, "but I know where I am."

Computer Science is the only discipline in which we view adding a new wing
to a building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

He's about as useful as a wax frying pan.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to