A simple bash script:
check_file() {
if [ -f "$1" ]; then
echo "File is good"
#call other functions
else
echo "No such file!"
fi
}
chieck_file "$1"
when I call my script passing a path to a file and that file has a whitespace or brackets in name, my shell script fails.
sh ./bash_script.sh /home/user/foo/foo\ bar\(1\).txt
Output:
No such file!
OS: RHEL8