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

Re: Probably very stupid script/bash question



On Wed March 5 2008 15:36:50 William Pursell wrote:
> As far as I can tell, the following 4 commands should
> all behave the same, but the last one hangs.  Can anyone
> see why?
>
> $ cat <(echo foo)
> foo
> $ bash -c 'cat <(echo foo)'
> foo
> $ echo foo | bash -c 'cat'
> foo
> $ bash -c 'cat' <(echo foo)

The last command is of the form "bash -c string file".
"bash file" reads commands from a file, but "bash -c string"
reads commands from the string instead, and apparently
ignores the file argument.  The file argument is normally
omitted when "-c string" is used.

--Mike Bird


Reply to: