Score:0

Bash program not being found, right in front of my face

dj flag

I keep trying to run a bash script in the terminal but it always returns with:

No such file or directory
program.sh: line 2: cd: /directory/to/my/program: No such file or directory
program.sh: line 3: ./directory: No such file or directory

Using Ubuntu 20.04.3

in flag
The error is not saying that the `.sh` file cannot be found, but that an `etterna` directory cannot be found in your home directory.
Yuri Sucupira avatar
cn flag
You don't need to type `bash etternalaunch.sh`, just make the script executable by running `chmod +x etternalaunch.sh` at its directory location (e.g. `~/Downloads/etterna`), then just run `./etternalaunch.sh` and bash will be automatically invoked to run such script. As @matigo explained, bash does execute the script, but then it reads the line 2 of `etternalaunch.sh`, informs you that it didn't find the directory `etterna` at `/home/j0hndoe/`, then it reads the line 3 of `etternalaunch.sh` and informs you that it didn't find `./etterna` (i.e. `~/Downloads/etterna/etterna), either.
dj flag
Is there any reason why it wouldn't find the directory? I made the script executable and it still gives me the same error. I'm new to linux as a whole.
Elder Geek avatar
cn flag
@butgabba The usual reason for a file or directory to not be found is that it doesn't exist. Other possible reasons would be corruption in the file system, or even a typo in the script. Please [edit] your post to include the output of `ls /home/j0hndoe`
Score:0
sa flag

The etternalaunch.sh shell script expects to be run from the parent directory of the etterna directory. The parent directory of the etterna directory is located at ~/Downloads/. Copy the etternalaunch.sh file from the etterna directory to the Downloads directory and run it again.

cp ~/Downloads/etterna/etternalaunch.sh ~/Downloads/
cd ~/Downloads/
./etternalaunch.sh
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.