stringing commands together

Archived topics about LMDE 1 and LMDE 2
Locked
Sleven

stringing commands together

Post 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?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
perham

Re: stringing commands together

Post 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.
Sleven

Re: stringing commands together

Post 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.
Last edited by Sleven on Wed Jan 01, 2014 12:36 pm, edited 2 times in total.
perham

Re: stringing commands together

Post 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.
Sleven

Re: stringing commands together

Post 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?
perham

Re: stringing commands together

Post by perham »

you should give the absolute path to your script.
Sleven

Re: stringing commands together

Post 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?
perham

Re: stringing commands together

Post 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
Sleven

Re: stringing commands together

Post by Sleven »

Thanks perham for all the help, seems to be working just as I want it to now thanks to you.
perham

Re: stringing commands together

Post 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.
Locked

Return to “LMDE Archive”