You are not logged in.

#1 2004-08-05 15:40:27

hcman
Member
From: Missoula, MT/Zaandam, Netherla
Registered: 2003-06-10
Posts: 66

install packages from a list with pacman

I want to install lots of packages all at once from a list I have in a textfile. Is there any way I can pipe the output of a textfile containing all the package names to pacman?

I tried the simple 'cat pkgs.txt | pacman -S' but that does not work.
Any ideas?

Arjan

Offline

#2 2004-08-05 16:01:45

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: install packages from a list with pacman

try like this:

pacman -Sy
pacman -S $(cat pkgs.txt)

Dusty

Offline

#3 2004-08-05 16:35:49

hcman
Member
From: Missoula, MT/Zaandam, Netherla
Registered: 2003-06-10
Posts: 66

Re: install packages from a list with pacman

Very clever! Thanks Dusty.

Now ehm...how does that work?

Arjan

Offline

#4 2004-08-05 16:45:08

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: install packages from a list with pacman

Basically, the construct $(command) takes the output of command and inserts it into the outside command...

for example,

if pidof xyz outputs 1248,

kill $(pidof xyz)
is identical to
kill 1248

There is a similar older construct that uses backtics (that's the one under the tilde, not the apostrophe), so that

kill `pidof xyz`

is identical to the above.  The new construct $() is more useful because it's easier to nest multiple commands as in

command 1 $(command2 $(command 3))

if that ever needed to be done.

So what the original command did was insert the output of the 'cat pkg.txt' command in the commandline.

Dusty

Offline

#5 2004-08-05 17:00:18

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: install packages from a list with pacman

... or take a look at this thread http://bbs.archlinux.org/viewtopic.php? … highlight=

Offline

#6 2004-08-05 18:11:51

hcman
Member
From: Missoula, MT/Zaandam, Netherla
Registered: 2003-06-10
Posts: 66

Re: install packages from a list with pacman

Dusty, thanks for the explanation. That's a useful thing to know.

lanrat, thanks for that suggestion. I did a search but never saw that thread.

Arjan

Offline

#7 2004-08-06 07:10:30

dpb
Member
From: Cyperspace?
Registered: 2004-04-11
Posts: 231

Re: install packages from a list with pacman

Dusty wrote:

There is a similar older construct that uses backtics (that's the one under the tilde, not the apostrophe), so that

Lier!
It's on TOP of the tilde!  :twisted:

Offline

#8 2004-08-06 15:38:08

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: install packages from a list with pacman

dpb wrote:
Dusty wrote:

There is a similar older construct that uses backtics (that's the one under the tilde, not the apostrophe), so that

Lier!
It's on TOP of the tilde!  :twisted:

Aye, I added a "at least on North American keyboards" addendum, but thought that sounded dumb. wink

Dusty

Offline

Board footer

Powered by FluxBB