On Mon, 16 Dec 2002, Cameron Simpson wrote: > BTW, you don't need all though sloshes, unless this came from a Makefile > (which I doubt because then there'd be lots of doubled $$s floating > around). > > Eg: > > for idx in 5 4 3 2 1 > do if [ -d $$SNAPSHOT/daily.$idx ] > then > $MV $SNAPSHOT/daily.$idx $SNAPSHOT/daily.`expr $idx + 1` > fi > done > just to tighten things up, you might consider any or all of the following:
1) use the sequential && (and) operator: (or not, personal taste here) [ -d $SNAPSHOT/daily.$idx ] && $MV $SNAP ... etc etc ... ^^ command sequencing (or whatever it's called) 2) use the curly brace expansion operator to filter out common stuff: $MV $SNAPSHOT/daily.{$idx,$((idx+1))} # the entire $MV command rday -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list