Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

odd even in shell script

# HOW TO FIND A NUMBER IS EVEN OR ODD IN SHELL SCRIPT
clear 
echo "---- EVEN OR ODD IN SHELL SCRIPT -----"
echo -n "Enter a number:"
read n
echo -n "RESULT: "
if [ `expr $n % 2` == 0 ]
then
	echo "$n is even"
else
	echo "$n is Odd"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: arch linux vscode 
Shell :: xrandr add 1366 
Shell :: remove stash files git 
Shell :: apache2 site 
Shell :: install rpm ubuntu 
Shell :: certbot delete certificate 
Shell :: install ngrok ubuntu 
Shell :: install .deb files in terminal linux 
Shell :: bash: /usr/local/bin/docker-compose: No such file or directory 
Shell :: undo commit git before push 
Shell :: add staged change to your last commit 
Shell :: list users debian 
Shell :: how to install vagrant on linux 
Shell :: bash loop over files in directory 
Shell :: cv2.error: OpenCV(4.5.4) D 
Shell :: settings not opening in ubuntu 18.04 
Shell :: generate py file from ui 
Shell :: powershell new folder 
Shell :: get mac address ubuntu 
Shell :: install powershell 
Shell :: jenkins initialadminpassword linux 
Shell :: npm install mocha dev dependency 
Shell :: check status smb linux 
Shell :: turn off bluetooth by default ubuntu 20.04 
Shell :: install visual studio code ubuntu 
Shell :: powershell wait 5 seconds 
Shell :: start jupyter notebook from terminal 
Shell :: ubuntu cron job log 
Shell :: Unable to resolve module ./theming/DarkTheme from 
Shell :: how to install postgresql in manjaro 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =