how to perform mathematical operations in shell script
Shell
#!/bin/bash
x=5
y=10
ans=$(( x + y ))
echo "$x + $y = $ans"#!/bin/sh
a=10
b=20
val=`expr $a + $b`
echo "a + b : $val"
val=`expr $a - $b`
echo "a - b : $val"
val=`expr $a \* $b`
echo "a * b : $val"
val=`expr $b / $a`
echo "b / a : $val"
val=`expr $b % $a`
echo "b % a : $val"
if [ $a == $b ]
then
echo "a is equal to b"
fi
if [ $a != $b ]
then
echo "a is not equal to b"
fi
Also in Shell:
- Title
- check directory size
- Category
- Shell
- Title
- git global username --replace-all
- Category
- Shell
- Title
- git remove tag from remote
- Category
- Shell
- Title
- ngb-tabset install
- Category
- Shell
- Title
- git pull everything from development branch to feature branch
- Category
- Shell
- Title
- call shell script from python
- Category
- Shell
- Title
- install magento 2 command line composer
- Category
- Shell
- Title
- how to update pip in linux
- Category
- Shell
- Title
- powershell sharepoint copy file to other site collection
- Category
- Shell
- Title
- npm warn ws butterfly install peer dependencies
- Category
- Shell
- Title
- how to delete a non empty directory in linux
- Category
- Shell
- Title
- reset branch on local git
- Category
- Shell
- Title
- git basic command tutorial
- Category
- Shell
- Title
- ubuntu set scale to 150
- Category
- Shell
- Title
- command to find out my git head version
- Category
- Shell
- Title
- store result of command in variable bash
- Category
- Shell
- Title
- powershell upgrade
- Category
- Shell
- Title
- digital bootcamps in gauteng
- Category
- Shell
- Title
- bash function
- Category
- Shell
- Title
- julia install linux
- Category
- Shell
- Title
- how to uninstall npm package
- Category
- Shell
- Title
- vagrant 16
- Category
- Shell
- Title
- ubuntu chmod codes
- Category
- Shell
- Title
- bash special dollar sign shell varaibles
- Category
- Shell
- Title
- get random number shell script
- Category
- Shell
- Title
- git reset hard
- Category
- Shell
- Title
- assign default value in shell script
- Category
- Shell
- Title
- powershell bulk rename and add extra string to filename
- Category
- Shell
- Title
- hasura squashmigrations
- Category
- Shell
- Title
- increase open file limit linux mac catalina mariadb
- Category
- Shell
- Title
- bash measure execution time
- Category
- Shell
- Title
- webpack install
- Category
- Shell
- Title
- how to revert commit in git
- Category
- Shell
- Title
- add passphrase to ssh agent?
- Category
- Shell
- Title
- tab to csv command line
- Category
- Shell
- Title
- powershell command line variables
- Category
- Shell
- Title
- set git pull rebase default
- Category
- Shell
- Title
- git cherry pick
- Category
- Shell
- Title
- stop docker container
- Category
- Shell
- Title
- linux view services
- Category
- Shell
- Title
- offline heic to jpg converter on linux
- Category
- Shell
- Title
- apt get install docker compose
- Category
- Shell
- Title
- react native expo project in github e commerce
- Category
- Shell
- Title
- create directory linux
- Category
- Shell
- Title
- linux red hat version
- Category
- Shell
- Title
- powershell script to copy mutliple files into a single file
- Category
- Shell
- Title
- cordova build release signed
- Category
- Shell
- Title
- install react bootstrap
- Category
- Shell
- Title
- rec: command not found
- Category
- Shell
- Title
- list number of files in each folder linux
- Category
- Shell
- Title
- install visual studio code raspberry pi
- Category
- Shell
- Title
- shutdown timer windows 10
- Category
- Shell
- Title
- luminati proxy manager
- Category
- Shell
- Title
- remove git tag
- Category
- Shell
- Title
- start mariadb on linux terminal
- Category
- Shell
- Title
- find all files edited after date linux
- Category
- Shell
- Title
- linux command for file size
- Category
- Shell
- Title
- add git user and email
- Category
- Shell
- Title
- git diff show only files
- Category
- Shell
- Title
- linux list
- Category
- Shell
- Title
- npm run custom script
- Category
- Shell
- Title
- install express globally
- Category
- Shell
- Title
- bash call another script relative to current script
- Category
- Shell
- Title
- grep and
- Category
- Shell
- Title
- how to get the size of directory in linux
- Category
- Shell
- Title
- shell hide tab
- Category
- Shell
- Title
- gnome-shell turn off
- Category
- Shell
- Title
- install pybind ubuntu
- Category
- Shell
- Title
- bash if statement
- Category
- Shell
- Title
- git pull onbly submodule
- Category
- Shell
- Title
- ubuntu install sfml
- Category
- Shell
- Title
- search for files in linux terminal
- Category
- Shell
- Title
- bash pass all arguments
- Category
- Shell
- Title
- free port in linux
- Category
- Shell
- Title
- serverless sqs batch size
- Category
- Shell
- Title
- chown
- Category
- Shell
- Title
- passport deploy to server
- Category
- Shell
- Title
- date linux show millis
- Category
- Shell
- Title
- install metasploit in kali linux
- Category
- Shell
- Title
- list directories recursively powershell
- Category
- Shell
- Title
- install flathub in linux elementary
- Category
- Shell
- Title
- xcode clean derived data command line
- Category
- Shell
- Title
- gatsby-plugin-typography
- Category
- Shell
- Title
- check if kubernetes is running
- Category
- Shell
- Title
- command git message
- Category
- Shell
- Title
- change ratio vmware ubuntu
- Category
- Shell
- Title
- matplotlib change he yticks to two number after digit
- Category
- Shell
- Title
- add description to commit git
- Category
- Shell
- Title
- linux telnet port
- Category
- Shell
- Title
- how to unadd gitr file
- Category
- Shell
- Title
- npm install express-handlebars
- Category
- Shell
- Title
- BDD framework in testcomplete github
- Category
- Shell
- Title
- git reset keep changes
- Category
- Shell
- Title
- vim ubuntu install
- Category
- Shell
- Title
- adding remote origin git
- Category
- Shell
- Title
- close chrome tab from command line ubuntu
- Category
- Shell
- Title
- /usr/local/share/doc/node is not writable.
- Category
- Shell
- Title
- debian 10 buster mysql
- Category
- Shell
- Title
- git delete tag name
- Category
- Shell
- Title
- how to zip a file in linx
- Category
- Shell