Edit detail for ksh scripting revision 3 of 4

1 2 3 4
Editor: rgouveia
Time: 2009/09/15 20:09:02 GMT+2
Note:

added:

To get each line of a file into a variable iteratively do:
{ while read myline;do
   # process $myline
done } < filename

To catch the output of a pipeline each line at a time in a variable use:
last | sort | {
while read myline;do
   # commands
done }

http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html

for i in $(`ls -1) ; do echo $i; done


# generate 01-12 numbers with jot
# and use wget to get the files
# if they don't exit (-nc) 
for i in `jot -w '%.2u' 12`; 
do 
  wget -nc http://www.example.com/r/r2005$i.pdf ; 
done

To get each line of a file into a variable iteratively do:
{ while read myline;do
   # process $myline
done } < filename

To catch the output of a pipeline each line at a time in a variable use:
last | sort | {
while read myline;do
   # commands
done }

http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html