Re: [Fish-users] command substitution into one word

2015-03-26 Thread Elias Assmann
Thanks for the additional approaches (in I fact I new about neither IFS in fish nor the {list}\n feature), as well as the pointers to the discussions. I searched the mailing list before I posted, but not the github page. Elias

Re: [Fish-users] command substitution into one word

2015-03-26 Thread Elias Assmann
On 03/26/2015 06:23 PM, Greg Reagle wrote: > ~> /bin/ls -1a /cdrom | xargs -I '{}' -0 echo a '{}' b You are right, thanks. I had actually half-remembered that feature, but failed to see it in a quick glance at the xargs documentation. Elias ---

Re: [Fish-users] command substitution into one word

2015-03-26 Thread Glenn Jackman
A couple of relevant issues on github: https://github.com/fish-shell/fish-shell/issues/1656 https://github.com/fish-shell/fish-shell/issues/159 The problem: can't capture command substitution output with newlines intact $ set out (seq 5) > $ echo "$out" > 1 2 3 4 5 To do it properly, we need to

Re: [Fish-users] command substitution into one word

2015-03-26 Thread Greg Reagle
On Thu, Mar 26, 2015, at 01:07 PM, Elias Assmann wrote: > On 03/26/2015 03:51 PM, Greg Reagle wrote: > > How does this work? > >svnlist | xargs -0 svn ps svn:ignore > > That is a neat idea, but in this case it does not work like that because > ‘svn propset’ wants the property value first. Fr

Re: [Fish-users] command substitution into one word

2015-03-26 Thread Elias Assmann
On 03/26/2015 03:51 PM, Greg Reagle wrote: > How does this work? >svnlist | xargs -0 svn ps svn:ignore That is a neat idea, but in this case it does not work like that because ‘svn propset’ wants the property value first. From the help: > svn h ps propset (pset, ps): Set the value of a pro

Re: [Fish-users] command substitution into one word

2015-03-26 Thread Greg Reagle
This looks promising: ~> /bin/ls -1a /cdrom . .. ~> /bin/ls -1a /cdrom | xargs -0 echo a a . .. Note that echo is called only once (only one 'a') and the newlines are still there. The trick is that xargs is expecting a null character to separate the arguments, which is not there, so it's all tre

[Fish-users] command substitution into one word

2015-03-26 Thread Elias Assmann
Hi Fishers, In fish, command substitution returns a list when the command outputs multiple lines, like this: > function foo; echo $argv[1]; end > foo (echo a; echo b; echo c) a But what do you do when you need the output as one word? (Where, in Other Shells, you might do ‘foo "$(echo a; ech