for loops
Bruce Varney
asg at sage.cc.purdue.edu
Fri Apr 5 14:14:59 AEST 1991
In article <2816 at maestro.htsa.aha.nl> miquels at maestro.htsa.aha.nl (Miquel van Smoorenburg) writes:
}In article <3693 at ux.acs.umn.edu> edh at ux.acs.umn.edu (Merlinus Ambrosius) writes:
}>In sh, I'd like to do something like a BASIC for loop. Say I have $FILES
}>set to some number, and I'd like to go through a loop $FILES times. Can
}>this be done in sh?
}
}POSIX states that sh(1) should be able to evaluate expressions,
}while [ $FILES != 0 ]
}do
} echo -n '* '
} FILES=$[$FILES - 1]
}done
}
No, but the new bash (version 1.07) can! ;-)
}
---------
### ##
Courtesy of Bruce Varney ### #
aka -> The Grand Master #
asg at sage.cc.purdue.edu ### ##### #
PUCC ### #
;-) # #
;'> # ##
More information about the Comp.unix.shell
mailing list