I'm really going crazy with this simple problem. I just copy-pasted for one hour and nothing works. I'm using GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
I just need to indicate two paths in two different variables, so later I can compare the files they are pointing at. I tried:
#!/bin/bash
unset PATH_A
unset PATH_B
PATH_A= "./assets/myTargetFile.ts"
PATH_B= "../main/assets/myTargetFile.ts"
diff -q "$PATH_A" "$PATH_B" 1>/dev/null
if [[ $? == "0" ]]
then
echo "The same"
else
echo "Not the same"
fi
But I'm getting those errors:
- line 5: declare: `./assets/myTargetFile.ts': not a valid identifier
- If I remove "declare", I get: "line 5: ./assets/myTargetFile.ts: Permission denied"
Any idea?