I am trying develop a bash script which processes a list of files which may contain space names. (I have already consulted Trouble in script with spaces in filename and Why I can't escape spaces on a bash script?, but can not seem to perfect my script.)Here is my script. The actual process is more complicated which I reduce here to simple file command. #!/bin/bashif [ $# -eq 0 ]; then   echo Usage is $0 <files to be tested>   exitfiallfilestobetesed=$@for filetobetested in $allfilestobetesteddo    file $filetobetesteddoneHow do I improve my script?
Process a file list with space in file names
bash;shell script;whitespace
You should probably get rid of your allfilestobetested variable if you can:for filetobetested in $@; do    file $filetobetesteddonewill expand correctly