Excerpts from Martin Bähr's message of 2014-06-25 04:24:37 +0200: > function echonl > for i in $argv > echo $i > end > end > compare: > /> set foo (ls) > /> wc (echo $foo | psub) > 1 35 264 /tmp/.psub.29424.6249 > /> wc (echonl $foo | psub) > 35 35 264 /tmp/.psub.29424.104 > > note that this even works like that in bash: > $ foo=`ls` > $ wc <(echo $foo) > 1 35 264 /dev/fd/63 > > on command substitution, newlines are discarded.
ooops, this is wrong! for bash the newlines are discarded by echo: $ wc <(echo "$foo") 35 35 264 /dev/fd/63 http://stackoverflow.com/questions/15184358/how-to-avoid-bash-command-substitution-to-remove-the-newline-character greetings, martin. -- eKita - the online platform for your entire academic life -- chief engineer eKita.co pike programmer pike.lysator.liu.se caudium.net societyserver.org BLUG secretary beijinglug.org foresight developer foresightlinux.org realss.com unix sysadmin Martin Bähr working in china http://societyserver.org/mbaehr/ ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users