> On Wed, Aug 20, 2014 at 3:05 PM, Glenn Jackman <jack...@pythian.com>
wrote:
>>
>> This got me at first too. Command substitution returns a *list*, not just
>> a string. When you prefix a list with a string ("http://";), that string
is
>> prefixed onto each member of the list:
>>
>> $ function tmp; echo 1; echo 2; echo 3; end
>> $ echo "foo"(tmp)
>> foo1 foo2 foo3
>>
>> If the list is empty, the string is prefixed onto nothing, hence the
empty
>> output.

Wow, interesting that "foo (...)" might behave so differently to "foo(...)"!

Playing with this a bit:

$ echo foo (echo "bar baz")
foo bar baz
$ echo foo(echo "bar baz")
foobar baz
$ echo foo (echo -e "bar\nbaz")
foo bar baz

But (!):

$ echo foo(echo -e "bar\nbaz")
foobar foobaz




Michael
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to