Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

swapping of two numbers without using third variable in shell script

#!/bin/bash
echo "enter first number"
read a
echo "enter second number"
read b
echo "a before swapping is $a and b is $b"
#swapping
a=$((a+b))
b=$((a - b))
a=$((a-b))
echo "a after swapping is  $a and b is $b"
Comment

PREVIOUS NEXT
Code Example
Shell :: babel core 
Shell :: wpa passphrase for raspberry pi 
Shell :: install insomnia mac brew 
Shell :: show users in sudo group 
Shell :: git merge cancel 
Shell :: pm2 adonis 5 
Shell :: install bedrock minecraft on linux 
Shell :: delete docker logs linux 
Shell :: mysql port check ubuntu 
Shell :: install openjdk 8 debian 10 
Shell :: git log one line 
Shell :: fingerprint login disabled ubuntu 20.04 
Shell :: git user email 
Shell :: artisan migration rollback 
Shell :: wsl default user 
Shell :: pip install upgrade all 
Shell :: linux open current directory in gui 
Shell :: bash find all files containing string 
Shell :: mocha zsh: command not found: mocha 
Shell :: kill service by port number on windows 
Shell :: ubuntu trash folder 
Shell :: error: RPC failed; curl 28 OpenSSL SSL_read: Connection was reset, errno 10054 send-pack: unexpected disconnect while reading sideband packet fatal: the remote end hung up unexpectedly Everything up-to-date 
Shell :: gdown download zip file 
Shell :: create a script that counts the number of directories in the path. 
Shell :: delete distro 
Shell :: ubuntu list latest installed packages 
Shell :: Waiting for your editor to close the file... 
Shell :: color picker linux 
Shell :: terminal get folder size windows 
Shell :: autopep8 command command 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =