[nylug-talk] hey bash! stop smushing my commands

Chandhee Thala cthala at gmail.com
Thu Apr 5 11:53:41 EDT 2007


Question for you bash gurus,

In Z Shell, I can do multi-line, command line editing, i.e. the following
command:

for i in `find /usr -type d  -maxdepth 2 -mmin -60`
do
    for k in `find $i -maxdepth 2 -type f -mtime -10`
    do
        echo $k
    done
done

(that was a totally random example pulled out of my ass) and if i run that
command and later pull it up from history, it looks exactly the way I type
it.

In bash however, that same command ends up looking smushed, i.e.:

for i in `find /usr -type d  -maxdepth 2 -mmin -60`; do for k in `find $i
-maxdepth 2 -type f -mtime -10`;  do echo $k;     done; done

How can I get bash to preserve the indentation?

C


More information about the nylug-talk mailing list