Sponsored Content
Full Discussion: Help Please...........
Top Forums Shell Programming and Scripting Help Please........... Post 302127143 by Shell_Life on Monday 16th of July 2007 09:58:44 AM
Old 07-16-2007
As there are so many unix versions, this is for Korn shell.
Please place the following line as the first in the shell:
Code:
#!/bin/ksh

Quote:
F07812000166320070627012300 X to
F07812000166220070627012300 X
add one the number in BOLD feild?? how can we do that...
that is ... to the digits form 7 to 13 fields??
Code:
#!/bin/ksh
typeset -i b
typeset -Z7 bOut
mOrigLine='F07812000166220070627012300 X'
mBeforeb=`echo ${mOrigLine} | cut -c1-6`
b=`echo ${mOrigLine} | cut -c7-13`
mAfterb=`echo ${mOrigLine} | cut -c14-`
b=${b}+1
bOut=${b}
echo ${mBeforeb}${bOut}${mAfterb}
echo ${mOrigLine}

 
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy