So I have script xxxx.sh and I have additional options on that script. The question is when user runs this script I need check if the file exist or does not exist? example: ./xxxx.sh -f /examplefolder/anyfilename.Json
for that i have this but idk if this will work?
# Validations # Does the file exist
if [[ ! -f $JSON_FILE ]]; then
echo "Error: The file $JSON_FILE does not exist."
exit 1
fi