Check the variable an integer


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

,

  1. No comments yet.
(will not be published)