Useful CLI tools (bash) for Arch Linux administration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
709 B

6 years ago
  1. #!/bin/bash
  2. ###########################################################
  3. # Show specific package, installed and available version
  4. echo ""
  5. PKGMGR="pacman"
  6. for p in $(echo "${@}"); do
  7. INSTALLDATE=$($PKGMGR -Qi $p | grep "Install Date" | awk -F ': ' '{print $2}')
  8. NEWDATE=$($PKGMGR -Si $p | grep "Build Date" | awk -F ': ' '{print $2}')
  9. echo "Installed: $($PKGMGR -Q $p) ($INSTALLDATE)"
  10. echo $($PKGMGR -Si $p | grep -E "Version.*:|Build Date.*:" | awk -F ': ' '{print $2}') | awk -v pkg=$p -F ' ' '{print "Available: " pkg " " $1 " ("substr($0,length($1)+1)")"}' | sed 's/( /(/g'
  11. echo ""
  12. #echo -e "Available: $p $($PKGMGR -Si $p | grep "Version.*:" | awk -F ' ' '{print $3}')\n"
  13. done