Horje
shell script for guess for magic number Code Example
shell script for guess for magic number
echo -en "Please guess the magic number: "
read X
echo $X | grep "[^0-9]" > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
  # If the grep found something other than 0-9
  # then it's not an integer.
  echo "Sorry, wanted a number"
else
  # The grep found only 0-9, so it's an integer. 
  # We can safely do a test on it.
  if [ "$X" -eq "7" ]; then
    echo "You entered the magic number!"
  fi
fi




Shell

Related
You need to install the imagick extension to use this back end xampp Code Example You need to install the imagick extension to use this back end xampp Code Example
how to check bash runs with sudo Code Example how to check bash runs with sudo Code Example
xampp shell fonts Code Example xampp shell fonts Code Example
Install Deno - Scoop (Windows) Code Example Install Deno - Scoop (Windows) Code Example
untar in specific folder Code Example untar in specific folder Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11