Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14217

Re: cat<(echo text) not same as cat <(echo text)

From Ilkka Virta <itvirta@iki.fi>
Newsgroups gnu.bash.bug
Subject Re: cat<(echo text) not same as cat <(echo text)
Date 2018-06-04 12:07 +0300
Message-ID <mailman.1097.1528103273.1292.bug-bash@gnu.org> (permalink)
References <CA+1SQ8fPSrcktEP=h1L+fo9vMcsG2YfZ06nhMd0kJzFqwOGDJg@mail.gmail.com>

Show all headers | View raw


On 4.6. 06:48, Edward Huff wrote:
> That is unexpected.
> 
> bash --version
> GNU bash, version 4.4.19(1)-release (x86_64-redhat-linux-gnu)

I assume you'd like Bash to behave like ksh here, and to expand the 
process expansion filename as a distinct word instead of concatenating 
it with the surrounding strings?

     $ bash -c 'cat<(echo foo)bar'
     bash: cat/dev/fd/63bar: No such file or directory

     $ ksh -c 'cat<(echo foo)bar'
     foo
     cat: bar: No such file or directory

In this case, it would make sense to separate the words and make it just 
work like a redirection. But in some cases you might want the filename 
prefixed with a string, e.g.:

     somecmd --file=<(echo something)

Ksh's behavior makes that impossible.

-- 
Ilkka Virta / itvirta@iki.fi

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: cat<(echo text) not same as cat <(echo text) Ilkka Virta <itvirta@iki.fi> - 2018-06-04 12:07 +0300

csiph-web