On Mon, Dec 03, 2012 at 04:12:25PM +0100, Tadziu Hoffmann wrote: > > > Actually all shells that I know of don't specify that > > redirection take place at the end of the command line. > > Witness: > > > > $ <<<$HOME cat > > /home/mbianchi > > > > $ <<<$HOME >/tmp/i cat > > $ cat /tmp/i > > /home/mbianchi > > Hey, that's cool! I'd never even thought about it. > So with regard to "proper" left-to-right order we can say > > <input command >output
Exactly. For instance <infile >outfile while read a do process ${a} done Sidebar: I always use ${a} instead of $a so they standout more in the scripts, for readability. Also usages like ${a:-defaultvalue} are then not as big of a surprise to novice readers of my shell code. It's a shell variable with with "benefits". I wonder sometimes if anyone really understands _all_ of bash(1) . I know I don't. Heck, I never understood all of ksh . I'll claim that understood all of sh back in 1985 or so. You know, the original sh had a way to do 1 "here document" at the end of a shell script? : cat >outfile content more content : in a shell script file would cat the content, down to the end of the file, into outfile just as if you were typing it at a terminal! I think the <<EOF ... EOF syntax was introduced by Steve Bourne and/or John Mashey back in the before times. -- Mike Bianchi Foveal Systems 973 822-2085 mbian...@foveal.com http://www.AutoAuditorium.com http://www.FovealMounts.com