Page 1 of 1

stringing commands together

Posted: Wed Jan 01, 2014 11:58 am
by Sleven
I was able to create a custom launcher with a command line entry and it worked fine.

I want to add a second command to the first, do I add && between the commands? If not then how do you string them into one line?

Also it is a couple sudo commands that I want to string, is there a way to enter the password automatically so I don't have to do it manually each time?

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:00 pm
by perham
you can add && in a launcher, but a better idea is to create a simple custom script with all the commands inside, and create a launcher for that.

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:14 pm
by Sleven
How do I create a simple custom script file? Gedit? What should the extension be? How do I make the file executable.

Also is there a way to enter the password automatically, they are sudo commands.

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:35 pm
by perham
create another thread for bypassing password.

to create a custom command file, open gedit, write down your commands, save the file with any name you want. then open a terminal and run this:

Code: Select all

chmod +x [path to your file] 
then you can run it any time.

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:37 pm
by Sleven
Edit: I was able to create the script file and it runs fine on it own. The custom launcher throws an error when I try and run
it there. I used the format ./filename but it throws an error. What am I doing wrong?

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:41 pm
by perham
you should give the absolute path to your script.

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:43 pm
by Sleven
I figured out why the custom launcher didn't work, didn't have the path in the command line, seems to work fine now.

Is there a way to pre-enter the password so it doesn't have to ask me each time?

Re: stringing commands together

Posted: Wed Jan 01, 2014 12:52 pm
by perham
Sleven wrote:I figured out why the custom launcher didn't work, didn't have the path in the command line, seems to work fine now.

Is there a way to pre-enter the password so it doesn't have to ask me each time?
http://askubuntu.com/questions/159007/h ... a-password

Re: stringing commands together

Posted: Wed Jan 01, 2014 1:27 pm
by Sleven
Thanks perham for all the help, seems to be working just as I want it to now thanks to you.

Re: stringing commands together

Posted: Wed Jan 01, 2014 1:29 pm
by perham
Sleven wrote:Thanks perham for all the help, seems to be working just as I want it to now thanks to you.
glad it works. ;) happy new year.