LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2006, 04:07 PM   #1
Tha1
Member
 
Registered: Dec 2005
Distribution: Arch 2007.08-2
Posts: 57

Rep: Reputation: 15
How to do scripts in Linux


Hey,long time no see.
My question is this:how do I do scripts in Linux?
I'm trying to automate my Arch linux installation, so that i don't have to type all the lines needed to install packages (for example, vlc and gnome).
Also, from googling, I realized that the language is PHP, but I'm actually not sure, I hope that you can clarify me on that as well.

Sorry for the bad english

Cheers
 
Old 06-23-2006, 04:14 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
Also, from googling, I realized that the language is PHP
I don't think so. PHP is generally run through a webserver. Yes, there is a CLI version, but it is not installed with Arch by default.

If you simply want to automate a bunch of commands and run them consecutively just do something like:
Code:
#!/bin/bash

pacman -S package1
pacman -S package2
pacman -S package3
etc etc...

If you need to do anything a bit trickier then I suggest taking a look at "The Advanced BASH Scripting Guide". Too lazy to find a link just now but have a google.

If you know Perl or Python I think they will be installed by default.

Last edited by bulliver; 06-23-2006 at 04:15 PM.
 
Old 06-23-2006, 04:14 PM   #3
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Rep: Reputation: 51
Arch has a very good package manager called pacman. Check out the Arch Wiki for a complete description..

http://wiki.archlinux.org/index.php/Main_Page

Hope this helps

Bob
 
Old 06-23-2006, 05:43 PM   #4
Tha1
Member
 
Registered: Dec 2005
Distribution: Arch 2007.08-2
Posts: 57

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bulliver
I don't think so. PHP is generally run through a webserver. Yes, there is a CLI version, but it is not installed with Arch by default.

If you simply want to automate a bunch of commands and run them consecutively just do something like:
Code:
#!/bin/bash

pacman -S package1
pacman -S package2
pacman -S package3
etc etc...

If you need to do anything a bit trickier then I suggest taking a look at "The Advanced BASH Scripting Guide". Too lazy to find a link just now but have a google.

If you know Perl or Python I think they will be installed by default.
How can I specify in the script that I what a certain package and all of its dependencies installed?
 
Old 06-23-2006, 05:54 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
How can I specify in the script that I what a certain package and all of its dependencies installed?
Pacman will install any deps for "foo" automatically when you "pacman -S foo"
 
Old 06-23-2006, 06:14 PM   #6
Tha1
Member
 
Registered: Dec 2005
Distribution: Arch 2007.08-2
Posts: 57

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bulliver
Pacman will install any deps for "foo" automatically when you "pacman -S foo"
What I mean is: when i install normally, he presents me the dependencies and asks me if i want them installed, and if not, asks me for each one of the dependencies.
Do I need to specify it in the script, so that he doesn't ask me that,just installs it?
 
Old 06-23-2006, 06:23 PM   #7
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
What I mean is: when i install normally, he presents me the dependencies and asks me if i want them installed, and if not, asks me for each one of the dependencies.
Right, sorry, I see what you mean. "man pacman" shows a "--noconfirm" option that apparently skips all the "Are you sure" prompts. I am not sure if this will fully work for your purposes but maybe...I am not near my Arch box to test.
 
Old 06-24-2006, 09:20 AM   #8
Tha1
Member
 
Registered: Dec 2005
Distribution: Arch 2007.08-2
Posts: 57

Original Poster
Rep: Reputation: 15
Ok, i'll give it a try later. Thanks for the help!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 01:10 PM
shell scripts in linux dopper Linux - Software 3 10-05-2003 06:12 PM
mirc scripts in linux PPihus Linux - Software 5 09-03-2003 07:08 AM
Start Up Scripts in Linux clintonm9 Linux - Software 3 06-24-2003 10:37 AM
Linux Login Scripts te_conway Linux - Networking 3 11-29-2002 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration