I have a very simple shell script I wrote to launch my web browser from the terminal (long story), run-brave.sh;
#!/bin/sh
brave
I’ve marked it as executable with chmod +x, but when attempting to run it, nothing happens. I’ve also tried replacing the first line with #!/bash/bin which I’ve used previously and that didn’t work either.
I’ve used this exact format of script on Ubuntu and had no issues. I was able to make several scripts to launch different programs, all worked with a simple double click. I’m still very new to Manjaro so I’m sure there’s something simple I’m missing, but when looking up how to run a program via shell scripts on Manjaro, I couldn’t find anything. If anyone could point me in the right direction I’d be grateful.
A script with the content posted here and marked executable is perfectly fine and will work.
Why do you need a scipt file to start that browser in the first place?
Just type brave (which is even shorter than your script name) to have the same effect.
Now why on Earth would you try launching Brave from a shell script?
Unlike in Microsoft Windows, the current working directory is not part of the ${PATH}, which is an environment variable containing a colon-separated list of directories that the shell will look in for executables if the command you issued is not a shell builtin.
In Arch and Manjaro, you should put your shell scripts in ${HOME}/.local/bin, which is in the ${PATH}.
But ─ as has been said before ─ there is no need to create a shell script in order to launch Brave. Just enter it at the command prompt.
While I agree, that starting brave via bash script seems be odd, we all started somewhere with our scripts. I‘m sure I have a bunch if scripts more experienced users will shake their head about, but they made perfect sense to me at the time.
So let‘s just stay relaxed with each other.