stringing commands together

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

stringing commands together

Postby Sleven on Wed Jan 01, 2014 11:58 am

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 Sleven on Wed Jan 01, 2014 12:09 pm, edited 1 time in total.
LMDE 64 running Cinnamon on an HP Compaq Core2 Duo 4G Ram
User avatar
Sleven
Level 4
Level 4
 
Posts: 402
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Linux Mint is funded by ads and donations.
 

Re: stringing commands together

Postby perham on Wed Jan 01, 2014 12:00 pm

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.
AMD Phenom II X6 1090T 3.2GHz DDR3-1600 12GB ]LinuxMint 16 Cinnamon
Intel Pentium 4 540 3.2GHz DDR-400 2GB LinuxMint 16 Mate
Intel Pentium 4 1.5 GHz 512MB Debian Jessie LXDE
User avatar
perham
Level 3
Level 3
 
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Postby Sleven on Wed Jan 01, 2014 12:14 pm

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.
LMDE 64 running Cinnamon on an HP Compaq Core2 Duo 4G Ram
User avatar
Sleven
Level 4
Level 4
 
Posts: 402
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

Postby perham on Wed Jan 01, 2014 12:35 pm

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.
AMD Phenom II X6 1090T 3.2GHz DDR3-1600 12GB ]LinuxMint 16 Cinnamon
Intel Pentium 4 540 3.2GHz DDR-400 2GB LinuxMint 16 Mate
Intel Pentium 4 1.5 GHz 512MB Debian Jessie LXDE
User avatar
perham
Level 3
Level 3
 
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Postby Sleven on Wed Jan 01, 2014 12:37 pm

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?
LMDE 64 running Cinnamon on an HP Compaq Core2 Duo 4G Ram
User avatar
Sleven
Level 4
Level 4
 
Posts: 402
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

Postby perham on Wed Jan 01, 2014 12:41 pm

you should give the absolute path to your script.
AMD Phenom II X6 1090T 3.2GHz DDR3-1600 12GB ]LinuxMint 16 Cinnamon
Intel Pentium 4 540 3.2GHz DDR-400 2GB LinuxMint 16 Mate
Intel Pentium 4 1.5 GHz 512MB Debian Jessie LXDE
User avatar
perham
Level 3
Level 3
 
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Postby Sleven on Wed Jan 01, 2014 12:43 pm

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?
LMDE 64 running Cinnamon on an HP Compaq Core2 Duo 4G Ram
User avatar
Sleven
Level 4
Level 4
 
Posts: 402
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

Postby perham on Wed Jan 01, 2014 12:52 pm

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
AMD Phenom II X6 1090T 3.2GHz DDR3-1600 12GB ]LinuxMint 16 Cinnamon
Intel Pentium 4 540 3.2GHz DDR-400 2GB LinuxMint 16 Mate
Intel Pentium 4 1.5 GHz 512MB Debian Jessie LXDE
User avatar
perham
Level 3
Level 3
 
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Postby Sleven on Wed Jan 01, 2014 1:27 pm

Thanks perham for all the help, seems to be working just as I want it to now thanks to you.
LMDE 64 running Cinnamon on an HP Compaq Core2 Duo 4G Ram
User avatar
Sleven
Level 4
Level 4
 
Posts: 402
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

Postby perham on Wed Jan 01, 2014 1:29 pm

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.
AMD Phenom II X6 1090T 3.2GHz DDR3-1600 12GB ]LinuxMint 16 Cinnamon
Intel Pentium 4 540 3.2GHz DDR-400 2GB LinuxMint 16 Mate
Intel Pentium 4 1.5 GHz 512MB Debian Jessie LXDE
User avatar
perham
Level 3
Level 3
 
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 2 guests