SLUG Mailing List Archives
Re: [SLUG] Bash Question - Redirection of output determined by Variable name
- To: James Gray <james@xxxxxxxxxxxxxxxx>
- Subject: Re: [SLUG] Bash Question - Redirection of output determined by Variable name
- From: Matthew Hannigan <mlh@xxxxxxxxxx>
- Date: Sun, 7 Aug 2005 09:30:57 +1000
- Cc: slug@xxxxxxxxxxx
- User-agent: Mutt/1.3.28i
On Fri, Aug 05, 2005 at 08:01:02AM +1000, James Gray wrote:
> I thought /dev/stdout and /dev/stderr were the "POSIX-ly" correct forms? I've
> always used them in my scripts for this sort of thing and often move them
> from Linux <-> Solaris <-> BSD <-> AIX without needing much more than editing
> the #! line.
Yeah, I remembered those just after sending this message, and thought
they might always go to the "real" stdout/stderr. i.e. if redirected,
though I'm not sure that makes sense.
But it turns out these are just links to /dev/fd/1 and /dev/fd/2.
On Linux at least.
Likewise /dev/stdin -> fd/0