[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not so useless use of cat
From: |
Chet Ramey |
Subject: |
Re: Not so useless use of cat |
Date: |
Mon, 15 Sep 2014 09:02:48 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
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 "$i" >/dev/stdout; done > both
> arc3:~$ cat both
> second
>
> On Linux, /dev/stdout is part of the file system, so Bash opens it and
> lets the operating system do what it will.
And different operating systems behave differently. When the OS does the
equivalent of dup() on fd 1 in the kernel, you get behavior close to what
bash does.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Re: Not so useless use of cat, (continued)
- 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
- Re: Not so useless use of cat, Chet Ramey, 2014/09/18
- Re: Not so useless use of cat, arnold, 2014/09/18
- Re: Not so useless use of cat, Greg Wooledge, 2014/09/18
- Re: Not so useless use of cat, Chet Ramey, 2014/09/18
- Re: Not so useless use of cat, Dennis Williamson, 2014/09/16
- Message not available
- Re: Not so useless use of cat, Ralf Goertz, 2014/09/17
Re: Not so useless use of cat, Greg Wooledge, 2014/09/15
- Re: Not so useless use of cat,
Chet Ramey <=