Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
integer-number-check-in-bash-variables-1
tolikpunkoff
Aug 29th, 2016
864
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
Untitled
1 hour ago | 16.24 KB
Plasma-Theming.txt
3 hours ago | 1.03 KB
Untitled
3 hours ago | 16.36 KB
Untitled
4 hours ago | 4.95 KB
Untitled
4 hours ago | 33.09 KB
install_fonts_v2.sh
Bash | 5 hours ago | 4.04 KB
Untitled
5 hours ago | 23.72 KB
Untitled
7 hours ago | 17.70 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!