Advertisement
tolikpunkoff

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

Aug 29th, 2016
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.16 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement