|
Assignment
Your first assignment is to finsh the following bash script. The
beginning of the script will create 10 files named out1 .. out10. You
must add a few lines below to concatenate all 10 files into a new file
named alldates.txt
To your left you can select to see more details on this assignment if you
need them. You can also select tips if you need some suggestions to get
started on the assignment. Finally, you can select Solution to view a
solution to the problem and compare with your own.
Details
The statement: for i in 1 2 3 4
5 6
will cause $i to take on the values in the sequence specified. In this
case, $i will be set to 1, 2, 3, 4, 5, and 6.
do
date > out$i
done
The do loop above is then processed once for each value of $i.
The ">" symbol sends the
output from the command date
to the output file specified.
Tips
- Use another loop like the one on the top of the script.
- ">>" will append output
to a file.
- cat
A solution
|