bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ilkka Virta
Subject: Re: cat<(echo text) not same as cat <(echo text)
Date: Mon, 4 Jun 2018 12:07:37 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

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 / address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]