Score:0

cannot excute shell script with permission denied

rs flag
Lei

I tried to run shell script file

fin.sh: 1: fin.sh: cannot create fin.log: Permission denied

I tried to sudo chmod u+x fin.sh but still got the same error

cc flag
The error is that you cannot create/overwrite the fin.log file. Either it exists and doesn't have write permission for you or you group, or the directory in which you are trying to create the file doesn't have write permission your you/group.
Lei avatar
rs flag
Lei
the file fin.sh is to execute a command and save the output in fin.log using `>>`
waltinator avatar
it flag
What's the directory that `fin.sh` is in? Is it mounted with `noexec`? `mount`. Explore your Mount/Read/Write/Execute problems with `https://github.com/waltinator/pathlld`, a `bash` script to show the permissions, mount options along the path to an object or objects.
lucki1000 avatar
us flag
if you're not interested in security, try something like that `yourcommand | sudo tee -a fin.log`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.