The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-09-2008
cesarNZ cesarNZ is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 70
subtracting variables in ksh

hi all,
how do i subract variables in shell ?? am trying to space out the headers and the output generated by the shell so they all line up :

currently the output is like this :


servers : users

server1 : 10
latestServer : 50



so i thought i would keep a constant e.g 40 and subtract the length of the server name from it.

count=${#myserver}; <-- this is the length of the server name
spaces=((40 - $count )); <-- this doesnt really work

thanks in advance.