[colug-432] Nice Plain Text Columns and Avoiding NIH: expand: not
Richard Troth
rmt at casita.net
Mon Aug 29 15:39:06 EDT 2011
I commonly use more than two stages even at a shell prompt.
Even if not required, I often use 'cat' instead of "<" for the
consistency of stage|stage|stage syntax. It's easier for my eyes to
parse just "|" than to also parse "<".
But w/r/t scripting, there's no way to know for sure which method
works best (spelled out or "tight" with coolness) for your crew until
you *are* the poor SOB at 3AM Ethan and Rick mention. Usually,
verbose works better. Depends on whether you are all a bunch of shell
gurus or noobs.
What is sad is to have written a script for excruciating clarity and
then get someone to dis your scripting hygiene as "too verbose".
-- Rick; <><
On Mon, Aug 29, 2011 at 12:51, Stephen Potter <spp at unixsa.net> wrote:
> On 8/29/2011 12:39 PM, Rob Funk wrote:
>> A lot of times I'll write scripts that look something like:
>> cat foo |\
>> filter --somehow |\
>> another-filter --some-other-way |\
>> more-filtering --with-more-options
>>
>> And it's nice to be able to easily vary the source (e.g. cat, echo, curl)
>> separately from the filters, with a direct pipeline from beginning to end.
>
> If you're chaining multiple commands in a script, I can see the utility
> of having the initial cat there so the input doesn't get completely
> lost. That's actually one of the first really good reasons I've heard
> for using cat in a pipe! But, for CLI usage, how often do you really do
> more than two commands?
>
> filter foo | other-filter
>
> -spp
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>
More information about the colug-432
mailing list