Fish - The friendly interactive shell
Posted Jun 1, 2005 19:29 UTC (Wed) by
kjetilho (guest, #30261)
In reply to:
Fish - The friendly interactive shell by liljencrantz
Parent article:
Fish - The friendly interactive shell
It would be bad to make the behaviour in scripts different from that in interactive use, often I just paste my recent command history and make it a script for later use. The obviously correct ;-) solution is to make globbing work differently in list context, ie. when used as an iterator in for loops.
Doing this correctly in bash is quite painful -- you need to handle case where the glob matches literally:
for i in *.c; do
[ "$i" = "*.c" -a ! -e "$i" ] && break
do_stuff "$i"
done
fish sure is neater:
for i in *.c; do_stuff $i; end
(
Log in to post comments)