I am trying to get the script all the files in the form of "$ variable". *
the parameter is always a file with the extension .001 I want to find all files with the same name, but a different extension, for example $ file.002, file.003, etc., For example:
first="$1"
others=${first%.001}
ls $others"*"
My problem is in the file: file[success].mpg.001
and what gets from ls file[success].mpg*, which gives me
ls: cannot access file[success].mpg*: No such file or directory
because I lshave to see:
file\[success\].mpg*
I tried everything, the only thing I noticed ls gave the parameter $ 1, but not if it was uploaded by $ file after I made the file = $ 1. So, I think, how to change a variable in a parameter?
source
share