Skip to content

Instantly share code, notes, and snippets.

@theodorosploumis
Created May 27, 2016 00:41
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 theodorosploumis/02b4e4df8989cb0072dfbbbdf89922bd to your computer and use it in GitHub Desktop.
Save theodorosploumis/02b4e4df8989cb0072dfbbbdf89922bd to your computer and use it in GitHub Desktop.
Print versions of software installed. Useful for README.txt, CHANGELOG.txt etc. Mainly for Drupal.
#!/usr/bin/env bash
# Print versions of installed software
# bash /scripts/software.sh >> /SOFTWARE.txt
# Print distribution info
echo -e "-----------------------------------\n"
echo -e "$(uname -a)"
echo -e "---------------------------------- \n"
# Print date created
echo -e "Date: $(date)\n"
# Prints installed packages
# 6 items list
dpkg --list | grep -E '(^|\s)php5-cli($|\s)|(^|\s)phpmyadmin($|\s)|(^|\s)mysql-server($|\s)|(^|\s)apache2($|\s)|(^|\s)supervisor($|\s)|(^|\s)php5-xdebug($|\s)' \
| awk '{ print NR ". " $2 ": " $3 }'
# Print Drush version
echo "7. drush: $(drush --version | awk '{print $4}')"
# Print drupal console version
echo "8. drupal: $(drupal --version | awk '{print $4}')"
# Print composer version
echo -e "9. composer: $(composer --version | awk '{ print $3}')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment