A .net bash script cannot access drive in spite of it having read/write access

BigBadBeef

Member
Joined
Sep 23, 2021
Messages
41
Reaction score
16
Credits
408
Hi,
I am trying to run a bash script whose purpose is to perform some updates which will add/replace or remove files as needed. However the aforementioned script is reporting to have no access to the drive, all the while I have already set read/write permissions set in the UI. The path of the drive is visible on the screenshot provided. neither BASH nor the SUDO BASH command works. Other applications are having no trouble accessing the drive.

The .net runtime is installed and aliased properly using the snap package manager.
Screenshot from 2021-12-03 19-15-21.png
 


JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,378
Reaction score
1,949
Credits
9,117
What are the permissions of the ‘install on Linux.sh’ script?

Open a terminal, navigate into the directory containing the script and make sure it’s executable:
Bash:
ls -alh ./install\ on\ Linux.sh
That will list information about the script.
If the permissions do not have any x permissions set, then the script is not executable.

In which case run:
Bash:
chmod +x ./install\ on\ Linux.sh

Also check the first line of the script, to see if it contains a shebang. That way we can determine the best way to run the script:
Code:
head -n 1 ./install\ on\ Linux.sh
That will display the first line of the script.

If the first line of the script contains something like this:
Bash:
#!/bin/bash
Or this:
Bash:
#!/usr/bin/env bash
Then you can run the script like this:
Bash:
./install\ on\ Linux.sh
Or if it needs to be ran as root:
Code:
sudo ./install\ on\ Linux.sh

Without a shebang, you may have to run it like this:
Bash:
bash ./install\ on\ Linux.sh
Or if root is required:
Bash:
sudo bash ./install\ on\ Linux.sh
 
OP
B

BigBadBeef

Member
Joined
Sep 23, 2021
Messages
41
Reaction score
16
Credits
408
Please note that the previous version of the very same script used Mono instead of .net which did not have the same issue. The script also has all the permissions. Here is a screenshot of the script itself.
Screenshot from 2021-12-04 19-28-55.png
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Latest posts

Top