Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!xanth!mcnc!gatech!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: How to make a script file? Message-ID: <7543@chinet.chi.il.us> Date: 27 Jan 89 04:01:26 GMT References: <5828@phoenix.Princeton.EDU> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Distribution: na Organization: Chinet - Public Access Unix Lines: 32 In article <5828@phoenix.Princeton.EDU> amlovell@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 > >Can you tell me how to do this? >Even if I must have 56 lines to meet the above criteria? >Thanks mucho. #! /bin/sh #first arg is N i=0 while [ $i -lt 56 ] do i=`expr $i + 1` case $i in ?) i=0$i ;; esac cat glob.$1 bb${i}.$1 | Mail bb$i done exit Les Mikesell