Please help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Please help
# 1  
Old 05-28-2007
Please help

I want to write one script which split one stirng and store two splited portion in different variable.
Exmp:

string is S070528A
Split it Into S070528 and A
and store it into two variables. like
fiirstname=S070528
lastname=A
# 2  
Old 05-28-2007
Code:
str=S070528A
firstname=${str%?}
lastname=${str#$firstname}

# 3  
Old 05-28-2007
thanx..
it will work.
Login or Register to Ask a Question

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