|
From: Scott W. <sw...@ch...> - 2008-02-17 16:38:39
|
Ethan A Merritt wrote:
> On Sunday 17 February 2008 02:22, Scott Worley wrote:
>> gnuplot <<< 'plot "'<(echo -e '1\n3\n2')'" with lines; pause 10'
>
> Which one of those two redirections is causing the error?
The <() redirection. The above effectively becomes
gnuplot <<< 'plot "/dev/fd/63" with lines; pause 10'
(as demonstrated by replacing "gnuplot" with "cat":
$ cat <<< 'plot "'<(echo -e '1\n3.5\n2')'" with lines; pause 10'
plot "/dev/fd/63" with lines; pause 10
$ ls -l <( echo foo )
crw-rw-rw- 1 root wheel 22, 63 Sep 23 2005 /dev/fd/63
) and then gnuplot refuses to read from /dev/fd/63 because it's neither
a file nor a pipe in *BSD.
This syntax used to work because in earlier versions of bash <() was
implemented with named pipes in /tmp. Under bash 3.1:
$ cat <<< 'plot "'<(echo -e '1\n3.5\n2')'" with lines; pause 10'
plot "/var/tmp//sh-np-3368567213" with lines; pause 10
$ ls -l <( echo foo )
prw------- 1 chkno wheel 0 Feb 17 08:34 /var/tmp//sh-np-1203260826
|