Shell Script Division,Subtraction,Addition


Floating Point Division
X=2
Y=4
echo - | awk '{ print '$X'/'$Y'}'
Subtraction on Shell Script
X=2
Y=4
echo $((X-Y))
Float Shell Script
X=100
printf "%.2f\n" $X
Addition on Shell Script
X=1 Y=2 Z=3
echo $((X+Y+Z))
Remove Space On Shell Script
X="1 2 3 4 5"
echo $X | sed -e 's/[\t ]//g;/^$/d'
Advertisements

2 thoughts on “Shell Script Division,Subtraction,Addition

  1. Johnb834 May 22, 2014 at 4:33 am Reply

    I am impressed with this website, rattling I am a big fan. cfgecfkekdab

  2. Johnf917 May 22, 2014 at 4:33 am Reply

    I truly enjoy looking at on this web site , it contains superb blog posts. Heavierthanair flying machines are impossible. by Lord Kelvin. faeegeckedea

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: