[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not so useless use of cat
From: |
Bob Proulx |
Subject: |
Re: Not so useless use of cat |
Date: |
Sat, 13 Sep 2014 12:53:48 -0600 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Dennis Williamson wrote:
> Bob Proulx wrote:
> > And the subshell isn't needed either. Use a list.
> >
> > { for i in file[12] ; do cat "$i" ; done ;} > both
>
> There's no need for the curly braces and the last semicolon.
Of course you are totally right. I was distracted by the subshell as
a concept. For re-stitching file with redirections a subshell isn't
needed and a list is convenient.
> Note that the loop in this case can be replaced by
>
> cat file[12] > both
>
> I failed to spot that in my earlier reply.
Me too. (But usually these are from more complex examples that can't
be simplified as much. It is just that all of the details aren't shown.)
Bob
- Not so useless use of cat, Ralf Goertz, 2014/09/12
- Re: Not so useless use of cat, Dennis Williamson, 2014/09/12
- Re: Not so useless use of cat, Bob Proulx, 2014/09/12
- Re: Not so useless use of cat, Dennis Williamson, 2014/09/12
- Re: Not so useless use of cat,
Bob Proulx <=
- Message not available
- Re: Not so useless use of cat, Ralf Goertz, 2014/09/16
- Re: Not so useless use of cat, Bob Proulx, 2014/09/16
- Re: Not so useless use of cat, Greg Wooledge, 2014/09/16
- Re: Not so useless use of cat, Bob Proulx, 2014/09/16
- Re: Not so useless use of cat, Chet Ramey, 2014/09/16
- Re: Not so useless use of cat, Bob Proulx, 2014/09/17
- Message not available
- Re: Not so useless use of cat, Aharon Robbins, 2014/09/17
- Re: Not so useless use of cat, Andreas Schwab, 2014/09/17
- Re: Not so useless use of cat, Chet Ramey, 2014/09/17
- Message not available
- Re: Not so useless use of cat, Aharon Robbins, 2014/09/18