I'm using Windows Subsystem for Linux, and learning the terminal. I want to open applications on my desktop with the terminal, so I decided to make a bash script to cd to the .exe file and run it.
This is what I have:
cd "/mnt/Users/username/AppData/Local/Programs/'Opera GX'/"
./launcher.exeHowever, it gives me this error:
./operaLaunch.sh: line 1: cd: $'/mnt/Users/akaza/AppData/Local/Programs/Opera GX/\r': No such file or directory
./operaLaunch.sh: line 2: ./launcher.exe: No such file or directoryI don't know why the line 1 is different in the error message.
Edit: So, I downloaded Notepad++ and changed the line endings to the proper Unix ones, but still not getting the script to work. Also, yes, I had a typo in the quoting of my script. This is how my script looks now
cd "/mnt/c/Users/akaza/AppData/Local/Programs/'Opera GX'/"
./launcher.exeThis is the error message I get now:
./operaLaunch.sh: line 1: cd: /mnt/c/Users/akaza/AppData/Local/Programs/'Opera GX'/: No such file or directory
./operaLaunch.sh: line 2: ./launcher.exe: No such file or directory Maybe the whitespace?
91 Answer
So, thanks to Kamil Maciorowski for helping me understand, the problem was with the inclusion of the single-quotes inside of the double-quotes. After removing the single-quotes, my script is working as intended. Thanks for the help