I am trying to create a script that automates one line of command which is used for archiving selected files to tape and creating a text file with the archived files. a and b are inputs and in the example below and I define them as 03 and 15.
a=03
b=15
tar -cvf /dev/tapedrive file_03 file_04 file_05 .........file_15 > /text_files/backup_file_03-15.txt
the script I came up with is below,
#! /bin/bash
a=03
b=15
for (( c=$a; c<=$b; c++ ))
$tt=" ";
do
if[ ! $c $a ]
then
$c="0$c"
fi
$tt .= " file_".$c.""
end
echo tar -cvf /dev/tapedrive $tt > /text_files/backup_file_$a-$b.txt
done
it's 'echo' for now instead of 'do' to make sure I get the right final command line. I am receiving the error
jag5v1.sh: line 9: syntax error near unexpected token `$tt=" "'
jag5v1.sh: line 9: `$tt=" ";'
I would appreciate any input. Thanks!