This is about bash under macos Catalina but should run under Big Sur too.
I want to fill a variable with the content of an HTML file and filter it later with grep.
Only I get for the HTML file access denied.
As a test, I use
#!/bin/bash -xv
$cat "./omnikresponse.html" #(it doesn't matter whether I use the whole path or not).
The file has the following privileges.
16 -rw-r--r--@ 1 la staff 6384 Dec 15 17:23 omnikresponse.html
com.apple.TextEncoding 15
com.apple.lastuseddate#PS 16
com.apple.metadata:_kMDItemUserTags 42
com.apple.metadata:kMDLabel_yjfxnnrt6pupmoito5lwf3xyea 89
com.dropbox.attrs 26
de.codingmonkeys.seestate 92
In the security settings, the terminal has 'full disk access'. The script runs as the user and sits in the same folder as the HTML file. I can set the HTML file to 755 and then I have access but it is not really wanted for security reasons I guess.
How can I solve this? Why do I have to change the privileges for just reading the file?