UNIX Shell script to know input is integer or not

Unix jobs, career
(Apply hot Unix jobs)
Unix Shell script to know input is integer or not.

$vi  prg1
echo  "enter  a  number"
read  x
y='expr  $x  %  2'
if  test  $y  -eq  0
     echo  "Number  is  even"
    echo  "Number  is  odd"

Running Script
$sh prg1
enter a number
Number is odd
$sh  prg1
enter  a  number
Number  is  even


Popular Posts

The Growth of Machine Learning till TensorFlow

How to Fix Python Syntax Errors Quickly

7 AWS Interview Questions asked in Infosys, TCS

How to Use the ps Command in Linux

The best 5 differences of AWS EMR and Hadoop

Hyperledger Fabric: 20 Real Interview Questions

How to Decode TLV Quickly

AWS Vs Azure Load Balancers Top Insights

QlikView Server vs Publisher Top Differences Really Useful to Your Project

Top 10 SCALA Quiz Questions for Programmers