Help Please...........


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help Please...........
# 8  
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}

# 9  
Old 07-16-2007
yup

that works as expected in ksh..

I have made my defalult shell to bash... for ease of autocomplete by tab...

that fine in ksh...
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question