I have a file ~/filelist, where each line is a file's pathname, which may contain whitespaces:
/path/to/my file1
/another path/to/my file2
I have a script which can accept filenames as arguments:
myscript.sh "/path/to/my file1" "/another path/to/my file2"
The following commands will not work however
myscript.sh $(cat ~/filelist)
and
arr=($(cat ~/filelist))
myscript.sh "${arr[@]}"
How can I make the script work with ~/filelist? Thanks.