Skip to content

Instantly share code, notes, and snippets.

@deanishe
Created November 1, 2016 10:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanishe/e5ef5e3d98f01865c4a7b0064633fc8e to your computer and use it in GitHub Desktop.
Save deanishe/e5ef5e3d98f01865c4a7b0064633fc8e to your computer and use it in GitHub Desktop.
Extract installed package names from apt-get output
#!/usr/bin/env zsh
pkgs=()
packages() {
while read ln; do
echo -n "$( echo $ln | cut -d " " -f2 ) "
done
}
apt get install abc xyz | grep "Unpacking" | packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment