check value is number in cmd code example
Example 1: check value is number in cmd
echo off &echo.&echo off
set /p pilih=silahkan masukan adb port ? &
echo off &echo.&echo off
SET /a param="%pilih%" + 0
if not %param% == 0 echo hello wordl
pause
Example 2: check value is number in cmd
#!/bin/bash
var=a
if [ -n "$var" ] && [ "$var" -eq "$var" ] 2>/dev/null; then
echo number
else
echo not a number
fi