I can't run shell script
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
I can't run shell script
I've got Linux Mint 17 KDE. I also have a shell script, myshellscript.sh, which is located in the desktop. When I right-click it and go to Actions > Run in Konsole, the Konsole opens up and I get the following error message: Warning: Could not find '/home/marc/Desktop/myshellscript.sh', starting '/bin/bash' instead. Please check your profile settings. I'm not sure what I should do to run this file in this way (I already know how to run it using bash --> sh myshellscript.sh).
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: I can't run shell script
That's not how you run a bash script. That's how you run a sh script. bash and sh scripts are similar but different.oligalma wrote:I already know how to run it using bash --> sh myshellscript.sh
Is the first line of your script:
#!/usr/bin/env bash
If not, what is it?
Re: I can't run shell script
I added this line but it's still not working.xenopeek wrote:That's not how you run a bash script. That's how you run a sh script. bash and sh scripts are similar but different.oligalma wrote:I already know how to run it using bash --> sh myshellscript.sh
Is the first line of your script:#!/usr/bin/env bash
If not, what is it?
Re: I can't run shell script
Is the script contents something you can share? Right-clicking a script file and choosing to run it in Konsole just works here. The file needs to have a valid hashbang line (as indicated above) and needs to have been marked as being executable. After that is should just work. Perhaps there is an error in your script, like not using fully qualified paths to files it uses?
Re: I can't run shell script
I marked the script as executable and it worked at last! Many thanks.xenopeek wrote:The file needs to have a valid hashbang line (as indicated above) and needs to have been marked as being executable.