Skip to content

Instantly share code, notes, and snippets.

View prcongithub's full-sized avatar

Prashant Chaudhari prcongithub

  • Jombay
  • Pune
View GitHub Profile
@prcongithub
prcongithub / gv
Last active October 20, 2020 11:50
Get version for any command without worrying about the parameter to pass
#!/bin/bash
if [ -z "$1" ]
then
echo "Comand Argument Is Missing! Try get_version java"
fi
commands=("--version" "-version" "version" "-v" "-V" "--v")
for i in "${commands[@]}"