Check the variable is a integer or others.
#!/bin/bash
read Nau
if [ "${Nau//[^0-9]/}” == “$Nau” ]; then
echo “$Nau Is a number”;
else
echo “$Nau is not a number”
fi
Check the variable is a integer or others.
#!/bin/bash
read Nau
if [ "${Nau//[^0-9]/}” == “$Nau” ]; then
echo “$Nau Is a number”;
else
echo “$Nau is not a number”
fi
This entry was posted on 2009-05-24, 21:48 and is filed under linux. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
Fusion theme by digitalnature | powered by WordPress
Entries (RSS) and Comments (RSS) ^