You are not logged in.
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
try like this:
pacman -Sy
pacman -S $(cat pkgs.txt)
Dusty
Offline
Very clever! Thanks Dusty.
Now ehm...how does that work?
Arjan
Offline
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
... or take a look at this thread http://bbs.archlinux.org/viewtopic.php? … highlight=
Offline
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
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
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.
Dusty
Offline