Re: Not so useless use of cat

2014-09-15 Thread Greg Wooledge
On Fri, Sep 12, 2014 at 06:12:13PM -0600, Bob Proulx wrote: > (for i in file[12] ; do cat "$i" > /dev/stdout ; done) > both > > > $ cat both > > second > > Because the >/dev/stdout truncates the output. It writes the first. > Then the second one truncates the file and then writes the second.

Re: Not so useless use of cat

2014-09-15 Thread Chet Ramey
On 9/15/14, 8:14 AM, Greg Wooledge wrote: > On HP-UX, /dev/stdout is NOT an actual file in the file system, so it > is implemented by duplicating FD 1 within Bash. > > arc3:~$ uname -a > Linux arc3 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u1 i686 GNU/Linux > arc3:~$ for i in file[12]; do cat "$