Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
integer-number-check-in-bash-variables-1
tolikpunkoff
Aug 29th, 2016
831
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Bash
0.16 KB
| None
|
0
0
raw
download
clone
embed
print
report
#!/bin/bash
#check integer positive numbers in bash variables
if
(
echo
"$1"
|
grep
-E
-q
"^?[0-9]+$"
)
;
then
echo
"Number"
else
echo
"Not Number"
fi
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
13,OOO USD in 2 Days
CSS | 30 min ago | 2.12 KB
Easy 38% Arbitrage
CSS | 30 min ago | 2.12 KB
Untitled
1 hour ago | 16.17 KB
Untitled
3 hours ago | 0.33 KB
Untitled
3 hours ago | 1.41 KB
Untitled
3 hours ago | 13.79 KB
Untitled
3 hours ago | 1.57 KB
Untitled
3 hours ago | 0.44 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!