tolikpunkoff

integer-number-check-in-bash-variables-1

Aug 29th, 2016
268
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #check integer positive numbers in bash variables
  3.  
  4. if (echo "$1" | grep -E -q "^?[0-9]+$"); then
  5.     echo "Number"
  6. else
  7.     echo "Not Number"
  8. fi
RAW Paste Data