This of course doesn't solve all the use cases:

for i in */; cd $i; echo "i am at $i"; prevd; end

Maxim

On Fri, 18 Apr 2014 09:33:55 +0400, Martin Bähr  
<mba...@email.archlab.tuwien.ac.at> wrote:

> hi,
>
> i have been struggling with this recently:
>
> how do i run a sequence of commands in a loop without affecting the
> environment, most notably the working directory:
>
> in bash i can run this:
>
> for i in */; do (cd $i; echo "i am at $i"); done
>
> in fish it seems i need to remember where i was and make sure i get back  
> to that.
> sometimes though it would be nice not to have to worry about that
>
> greetings, martin.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to