You are not logged in.

#1 2015-09-22 14:17:12

alex_hmn
Member
Registered: 2014-10-01
Posts: 25

List packages without dependencies

Hello!
I've found the advice within wiki
https://wiki.archlinux.org/index.php/Pa … depends_on

But I've failed to execute this "script". It tells, that '(' is unexpected symbol. Can anyone give me advice how to list those packages without dependencies?
Thank you for attention!

Offline

#2 2015-09-22 14:25:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: List packages without dependencies

It's likely that one of the variables wasn't defined.  But it also seems that someone has been editing that wiki page and adding a lot of nonsense (and useless cats).  The following will do:

comm -23 <(pacman -Qtq) <(pacman -Qsq base base-devel)

EDIT: My suspicion on the cause of the problem is wrong.  I can't replicate an error with or without the variables defined in bash or sh.  It's likely a copy-pasta error and one of the '<' symbols was lost.  But debugging an overly complicated command is pointless - just use a better version.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-09-22 14:26:01

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: List packages without dependencies

It sounds like you're using /bin/sh rather than /bin/bash.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2015-09-22 14:26:51

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: List packages without dependencies

There are two different versions in that section of the wiki, so please be specific -- also about what the 'it' is that gives you an error message. See also https://bbs.archlinux.org/viewtopic.php?id=57855

That sticky says "complete output"; if you also include the complete command (and if it's not obvious, name the shell or other program that you fed this command to), we get a complete picture.

Best guess: your shell doesn't support the "<(cmd)" syntax.

Edit: slow...

Last edited by Raynman (2015-09-22 14:27:03)

Offline

#5 2015-09-22 14:39:46

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: List packages without dependencies

FYI the feature is called Process Substitution. I had to look it up because I'm always forgetting it. hmm


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2015-09-22 14:48:58

alex_hmn
Member
Registered: 2014-10-01
Posts: 25

Re: List packages without dependencies

File list.sh:

ignoregrp="base base-devel"
ignorepkg=""

comm -23 <(pacman -Qtq) <(pacman -Qsq base base-devel)

Command line output:

~> sh list.sh
list.sh: line 4: syntax error near unexpected token `('
list.sh: line 4: `comm -23 <(pacman -Qtq) <(pacman -Qsq base base-devel)'
~>

Offline

#7 2015-09-22 14:50:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: List packages without dependencies

Can you run that command directly from the command line?

(note: please use code tags for code, not quote tags)

EDIT: I was wrong, it is the explicit use of /bin/sh.  I could have sworn it worked for me with a bin/sh hashbang, but now it doesn't.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2015-09-22 14:58:32

alex_hmn
Member
Registered: 2014-10-01
Posts: 25

Re: List packages without dependencies

I've tried to use bash instead of fish and everything looks fine. Interesting, how one should execute this command using fish. I'm going to search for it now.

Thanks for advises!

Offline

#9 2015-09-22 15:02:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: List packages without dependencies


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB