Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

GNU/Linux using comm with a file and the output of a command

I want to use the comm command to compare a text file and the output of a command.

My first idea was to run:

comm packagesList $(pacman -Qe)

However, that doesn’t work. I also tried using ´pacman -Qe´ just in case, but it doesn’t work either. What am I missing?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

PS:

  • (packagesList is a text file with a list of my packages)
  • I’m running a fresh Arch Linux installation (straight out of the oven)

Thanks in advance

>Solution :

pacman -Qe | comm packagesList -

or

comm packagesList <(pacman -Qe)

Topics to research: what are standard streams and stdin/stderr/stdout, man comm -> When FILE1 or FILE2 (not both) is -, read standard input, what are command substitution and process substitution terms in shell context.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading