I want to copy some files from a remote computer into my own computer. These files have the following structure:
file00001sub0
file00001sub1
file00001sub2
file00123sub0
file00123sub1
file00123sub2
I am currently copying them with a script.sh
:
scp me@computer:file${1}sub* ./
Which means that I have to do things like script.sh 00001
and script.sh 00123
How can I make this work with trailing zeros? The number of digits is currently fixed, so I could in principle add the zeros by hand in the script, but there has to be a better way.