Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

leap year bash shell

#!/bin/bash
echo "Program to check for leap year or not"
read -p "Enter the year: " year
if [ $((year%400)) -eq 0 ]
then
        echo "$year is a leap year"
elif [ $((year%100)) -eq 0 ]
then
        echo "$year is not a leap year"
elif [ $((year%4)) -eq 0 ]
then
        echo "$year is a leap year"
else
        echo "$year is not a leap year"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: git check which files are committed 
Shell :: install vue-material 
Shell :: how to get the ip of a website 
Shell :: kubernetes get logs from pod 
Shell :: git global noverify 
Shell :: git initial commands 
Shell :: add local folder to git repo 
Shell :: ubuntu cmd time 
Shell :: apt-key export import 
Shell :: install drush ubuntu 20.04 
Shell :: how to add numbers in linux command line shell 
Shell :: Could not resolve dependency: peer @angular/common@"^8.0.0" from @ng-bootstrap/ng-bootstrap@5.3.1 
Shell :: stop npm server cmd 
Shell :: bash arguments parsing 
Shell :: como fazer commit github 
Shell :: how to upgrade docker-compose version 
Shell :: netbeans linux install 
Shell :: next js npm install 
Shell :: error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: the remote end hung up unexpectedly 
Shell :: check changes after git pull 
Shell :: ssh raspberryp 
Shell :: linux monitor outgoing https requests 
Shell :: rhythmbox 
Shell :: osx kill process on port 
Shell :: moving files in terminal 
Shell :: linux kill a port 
Shell :: signaling init process caused permission denied 
Shell :: sudo cd 
Shell :: list only directories in linux 
Shell :: scp from remote to local 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =