O
Oliver Saunders
In sh, you can do this:
$ cat <<donenow
like
jam
$
This suggests to me that cat should receive a temporary file as a result
of the heredoc that it can then display similar to the <() construct:
$ cat <(echo 'pie')
pie
$ echo <(echo 'pie')
/dev/fd/63
So I created a Ruby script called args_test.rb that looks like this:
#!/usr/bin/env ruby
p ARGV
Here it is run with a <() construct.
$ ./args_test.rb <(echo 'pie')
["/dev/fd/63"]
All good. But with heredoc you get this:
$ ./args_test.rb <<donenow
Can anyone explain this?
I tried this in Io with the same results.
$ cat <<donenow
ii
like
jam
donenow
like
jam
$
This suggests to me that cat should receive a temporary file as a result
of the heredoc that it can then display similar to the <() construct:
$ cat <(echo 'pie')
pie
$ echo <(echo 'pie')
/dev/fd/63
So I created a Ruby script called args_test.rb that looks like this:
#!/usr/bin/env ruby
p ARGV
Here it is run with a <() construct.
$ ./args_test.rb <(echo 'pie')
["/dev/fd/63"]
All good. But with heredoc you get this:
$ ./args_test.rb <<donenow
[]i
like
jam
donenow
Can anyone explain this?
I tried this in Io with the same results.