labrab21

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# laboratory work 21
# task 12
# subtask 1
FN=$1
FN=${FN:="NULL"}
if [ $FN = "NULL" ]
then
echo -n "Please, enter name of file: "
read FN
fi
PF=$2
PF=${PF:="NULL"}
if [ $PF = "NULL" ]
then
echo -n "Please, enter postfix of first copie: "
read PF
fi
LE=$3
LE=${LE:="NULL"}
if [ $LE = "NULL" ]
then
echo -n "Please, enter the number of copies: "
read LE
fi
LI="1"
while [ "$LI" -le "$LE" ]
do
cp $FN "${FN}${PF}"
PF=`echo $PF | tr '1-9a-zA-Y' '2-9a-zA-Z'`
LI=`expr $LI + 1`
done