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
Last edited by mcarni (2013-01-09 22:26:34)
Works for me:
% cat tit #!/bin/bash comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > tit.txt
% ./tit % head tit.txt abs archey3 arch-install-scripts asciidoc autoconf autojump automake bash binutils bison
sorry and thanks graysky
I used to run my script with:
$ sh mkpklist
and this gives the error.
If I run it with
@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.
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
Thanks Xyne, I will look into armh...i didn't know
actually I didn't know that I didn't know so many things....