On Mon, Feb 21, 2011 at 11:35:09AM +0100, Jan Kanis wrote:
> > set foo first
> > echo $foo-(set foo second; echo)-$foo-(set foo third; echo)-$foo
> third--third--third
> Without the echo's inside the command substitutions the command gives an
> empty line as output. Don't know if that's a bug or a feature. Does anyone
> know if that's supposed to happen?
> 
> > set foo first
> > echo $foo-(set foo second; echo)-$foo-(set foo third)-$foo

one of the interesting things about command substitution is that it can
return a list and will be expanded accordingly, consider returning two
lines:

> echo start-(echo foo; echo bar)-stop
start-foo-stop start-bar-stop

so naturally, if the command returns 0 lines, the surounding string
will be expanded 0 times.

greetings, martin.
-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
services:   debugging, programming, training, linux sysadmin, web development
--
pike programmer      working in china                   community.gotpike.org
foresight developer  (open-steam|caudium).org              foresightlinux.org
unix sysadmin        iaeste.at                                     realss.com
Martin Bähr          http://www.iaeste.at/~mbaehr/               is.schon.org

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to