You are not logged in.
Hi guys,
I know it should be easy, but I keep failing...
I can generate the list of installed packages with:
comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist.txt
and I woudl like to integrate into my backup script.
I was testing it with a script with only two lines:
#! /bin/bash
comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist.txt
but I get:
mkpklist: line 3: syntax error near unexpected token `('
mkpklist: line 3: `comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist.txt '"
I tried different options with brackets in different places, but me being useless with these things I have no idea of what I am doing...
could anyone point me in the right direction?
Thanks a lot
M
Last edited by mcarni (2013-01-09 22:26:34)
Offline
Works for me:
% cat tit
#!/bin/bash
comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > tit.txt
And
% ./tit
% head tit.txt
abs
archey3
arch-install-scripts
asciidoc
autoconf
autojump
automake
bash
binutils
bison
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
sorry and thanks graysky
I used to run my script with:
$ sh mkpklist
and this gives the error.
If I run it with
$ ./mkpklist
it works...
sorry
M
Offline
@mcarni, you know that when you use "sh <script>" you are specifying sh as the shell the script will be run with. In otherwords, you are overriding the shebang (#!/bin/bash) with /bin/sh. On our systems, we actually don't have an actual /bin/sh, as it is a symlink to bash. But when it is called via that symlink, it actually does its best to act like the old bourne shell.
Offline
@ WonderWoofy,
ops... I actually didn't know, I thought that launching a script with "sh" or by "./" was the same thing...
when Graysky replied I did some google search and together with your explanation it all makes sense...
Thanks a lot
M
Offline
If you ever want to reinstall old packages, you may find armh useful.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks Xyne, I will look into armh...i didn't know
actually I didn't know that I didn't know so many things....
Thanks
M
Offline