How to make a script file?

Chris Torek chris at mimsy.UUCP
Fri Jan 27 14:56:32 AEST 1989


In article <5828 at phoenix.Princeton.EDU> amlovell at phoenix.Princeton.EDU
(Anthony M Lovell) writes:
>I want to write a shell script (or whatever) which will be used thusly:
>
>scriptname N   ( N an integer)
>for i := 1 to 56 do
>  cat glob.N bbi.N | Mail bbi
>
>It's pretty easy, I guess - important things to note are that the files
>and address aliases bbi must have I always as 2 digits.
>ie: bb09

Easy:

for j in 0 1 2 3 4 5; do for i in 0 1 2 3 4 5 6 7 8 9; do
	if expr $j$i \> 56; then break; fi
	cat glob.$j$i bbi.$j$i | Mail bbi$j$i # I think you meant this
done

Incidentally, spawning 56 sendmails without waiting would be frowned
upon on our machines. . . .  (Hint: /usr/lib/sendmail -oi)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list