suppose the user passed 5 arguments($1
$2
$3
$4
$5
), how do I cut off the first two arguments($1
$2
) and I only want the last 3 arguments
awk '{print $3,$4,$5} < $@'
what if I don't know how many arguments passed but I do not want the first two arguments
I can not use shift since I also need info from $2, what should I do then?
I ran into this problem when tar files in bash script when the user might use regular expressions like *.txt
and the shell will automatically convert that into file1.txt
file2.txt
(suppose there are only two .txt
files)