[sf-lug] Fwd: [UMALUG] bash scripting question

Tyler Trafford ttrafford at gmail.com
Wed Mar 5 07:48:29 PST 2008


Michael Paoli wrote:
>> Tyler Trafford wrote:
>>
>> My original script has:
>> #/bin/bash
>> at the top.
> 
> Ah, that would certainly make a difference - at least in many cases.

Yeah, thanks for all the detail.

> I mentioned before[1], but I'll also mention again that the <(list)
> construct isn't POSIX/SUS[2][3] standards compliant.  One may be well
> advised to generally code to the broadest applicable standards as
> feasible, to avoid issues with portability and other potentially
> unpleasant surprises and "gotchas".

What I was/am using this for is in a script for easily viewing/merging
differences in a git repository using vimdiff:

$VIMDIFF -n "$FILE" <(git diff $REV -- "$FILE" | patch -p1 -Rs -o /dev/stdout)

Since the primary use I have for this is with etckeeper[1], I could
potentially be looking at stuff where I don't want tempfiles, with
sensitive data in them, to keep track of.

That was my original thinking, in any case.

[1] http://kitenet.net/~joey/code/etckeeper/
-- 
Tyler Trafford

A sect or party is an elegant incognito devised to save a man from
the vexation of thinking.
                -- Ralph Waldo Emerson, Journals, 1831




More information about the sf-lug mailing list