I’m trying to get this ~/Desktop/Tor/tor-browser_en-US/ && ./start-tor-browser to run as a .sh. I've tried over and over again to get it to work, what am I doing wrong?
#!/bin/bash
chmod +x file.command ~/Desktop/Tor/tor-browser_en-US/ && ./start-tor-browser
It has execute permissions and is saved as an .sh.
#!/bin/shas the very first line of your script? – Terrance Apr 22 '15 at 03:19#!bin/bashand it has a line between it and my code. – Shonn Alves Apr 22 '15 at 03:21#!/bin/bashtells the script to run in the bash shell and not the sh shell. Change it to#!/bin/sh– Terrance Apr 22 '15 at 03:21sudo #!/bin/sh chmod +x file.command ~/Desktop/Tor/tor-browser_en-US/ && ./start-tor-browser? – Shonn Alves Apr 22 '15 at 03:24./start-tor-browser? Is that located in the~/Desktop/Tor/tor-browser_en-US/folder? if so, your script should be#!/bin/shas the first line. Andcd ~/Desktop/Tor/tor-browser_en-US/ && ./start-tor-browseras the second line. – Terrance Apr 22 '15 at 03:26chmod +x <filename>as a separate command after you save the file – mchid Apr 22 '15 at 03:26#!/bin/sh chmod +x file.command ~/Desktop/Tor/tor-browser_en-US/ && ./start-tor-browserand create an new .sh that sayschmod +x <filename>? – Shonn Alves Apr 22 '15 at 03:29chmod +xsets the executable bit for a file../start-tor-browseris the command to start whatever that is.chmod +xis not needed in a script, as it does not need to set the bit every single time you run it. I am assuming that~/Desktop/Tor/tor-browser_en-US/is the folder on the desktop wherestart-tor-browserexists? – Terrance Apr 22 '15 at 03:32#!/bin/shas the first line andcd ~/Desktop/Tor/tor-browser_en-US/ && ./start-tor-browseras the second line. – Shonn Alves Apr 22 '15 at 03:35