Date: Fri, 8 Sep 2006 09:24:57 -0700 From: David King <dking@ketralnis.com> To: freebsd-questions@freebsd.org Subject: Re: How do I give 2 parameters to programs in an unix enviroment? Message-ID: <F4A62A71-60CD-4283-9AAA-E32B590D8A5B@ketralnis.com> In-Reply-To: <20060908142842.GB30620@dan.emsphone.com> References: <45016BBC.8080803@kth.se> <F05BCFC5-60FB-423A-9CFC-4085612D307B@ketralnis.com> <20060908142842.GB30620@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>> Here's an example using zsh (I assume it's the same using bash, but >> different using tcsh or sh): [...] >> This uses the <() operator. [...] >> There's another, similar operator that does force it to use temp >> files, >> but I can never remember what it is :) [...] > Just for the archives, The =() operator puts the output to a temp file > and returns the filename to the main command. It has to wait for the > subshell to finish before running the main command, though. Ah, thanks, I'll try to remember that this time :) Note that the =() operator, because it uses regular files, doesn't have the issue that some programs won't know how to deal with it (that is, because they are regular files, they support things like fseek() etc). The downside, as Dan said, is that the entire command line isn't executed until all of the subshells within =() operators complete (so the example I gave could take a long time to have any output). Also note that the =() operator will put its temp files in / tmp by default (unless you set your shell to put them elsewhere), so if you have a command with a lot of output, make sure that your /tmp can take all of it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F4A62A71-60CD-4283-9AAA-E32B590D8A5B>