A response from a St. Louis colleague:
---------- Forwarded message ---------- From: Robert Citek [email protected] Date: Dec 17, 2006 7:42 PM Subject: Re: Fwd: Fwd: [DISCUSS] 10 Good Unix command line habits To: [email protected]
Also, in "Use escape sequences to manage long input", there's no need to put a backslash after a pipe (|), logical or (||), or logical and (&&). So, this:
~ $ cd tmp/a/b/c || \
mkdir -p tmp/a/b/c && \ tar xvf -C tmp/a/b/c ~/archive.tar
can be re-written as this:
~ $ cd tmp/a/b/c ||
mkdir -p tmp/a/b/c && tar xvf -C tmp/a/b/c ~/archive.tar
Happy Holidays to all.
Regards, - Robert
Don Ellis wrote:
Ed and Group,
Here's a note from one of our KC colleagues (to whom I forwarded this) pointing out an error on the page (which I noticed but didn't share).
--Don Ellis
---------- Forwarded message ---------- From: *Luke-Jr* <[email protected] mailto:[email protected]> Date: Dec 17, 2006 12:54 AM Subject: Re: Fwd: [DISCUSS] 10 Good Unix command line habits To: [email protected] mailto:[email protected]
Notes: In "Quote variables with caution", it says to use square brackets, and
then
goes on to give a correct example with curly braces. "Stop piping cats" only refers to piping to grep, but in reality there's almost never a good reason to pipe a single-file cat. The < operator provides a file on standard input. So "cat foo | wc -l" can become "wc -l < foo"
------- St. Louis Unix Users Group - http://www.sluug.org/ To unsubscribe from the SLUUG discussion mailing list, send a message to [email protected] with the word 'unsubscribe' as the body