stringing commands together

Archived topics about LMDE 1
Locked
User avatar
Sleven
Level 4
Level 4
Posts: 397
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

stringing commands together

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

perham
Level 3
Level 3
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Post by perham » 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
Sleven
Level 4
Level 4
Posts: 397
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

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

perham
Level 3
Level 3
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Post by perham » 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
Sleven
Level 4
Level 4
Posts: 397
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

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

perham
Level 3
Level 3
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Post by perham » 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
Sleven
Level 4
Level 4
Posts: 397
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

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

perham
Level 3
Level 3
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Post by perham » 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
Sleven
Level 4
Level 4
Posts: 397
Joined: Sun Oct 03, 2010 9:03 am
Location: Central Florida

Re: stringing commands together

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

perham
Level 3
Level 3
Posts: 118
Joined: Sat Dec 28, 2013 7:52 pm
Location: Belgium

Re: stringing commands together

Post by perham » 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

Locked

Return to “LMDE 1 Archive”