Date: Sun, 28 May 2006 22:40:00 +0200 From: "Ferdinand Haselbacher (jr.)" <axp@shacknet.at> To: freebsd-questions@freebsd.org Subject: Re: 2>&1 Message-ID: <20060528204000.GA4341@Hellrazor.bigfatflat> In-Reply-To: <1148822083.95778.100.camel@chaucer.jeays.ca> References: <00d601c68254$b814c330$6501a8c0@grant> <1148822083.95778.100.camel@chaucer.jeays.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 28, 2006 at 09:14:43AM -0400, Mike Jeays wrote: > On Sun, 2006-05-28 at 08:46 -0400, Grant Peel wrote: > > Hi all, > > > > When using cron, I understand the >/dev/null thing OK, but what exactly does > > >2&1 do? Is it usefull anywhere else? Where might one find ducumentation on > > it? > > > > -Grant > > > > > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > It directs both stdout and stderr to /dev/null. Look in 'man bash', or > any tutorial on bash for a more detailed description. Quite confusing > syntax, and a hard-to-remember incantation, IMHO. the trick of the "&" is that the fd (filediscriptor) is kept open and if you redirect fd 1 to a file and fd 2 to file it would get overwritten! one last word to Bash: bash seems to be nice, it is indeed, but for real good and compatible scripting i would recommend you to use plain sh. so far, Ferdinand Haselbacher
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060528204000.GA4341>