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 05-27-2009
amitanshu.verma amitanshu.verma is offline
Registered User
  
 

Join Date: May 2009
Posts: 2
Problem in converting number in shell script

Hi All,

I am writing a shell script in which I want to convert a number like :

Suppose the number is "98487657" and we have to convert it to "98000000", what I want to do is to retain first 2 digits and convert all remaining digits to "0".

Number could be of any length (length > 2).



Thanks in advance