The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Break a file into separate files chiru_h Shell Programming and Scripting 8 07-29-2008 12:06 AM
How to separate 0kb files from the rest!!! kumarsaravana_s Shell Programming and Scripting 3 04-02-2007 05:38 AM
to separate a specific pattern shriashishpatil Shell Programming and Scripting 11 03-06-2006 05:04 AM
separate out the column ust Shell Programming and Scripting 6 12-29-2005 04:11 AM
How to separate a variable whatisthis Shell Programming and Scripting 4 11-02-2004 10:49 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-12-2008
Registered User
 

Join Date: May 2008
Posts: 29
Separate string

i am a biginner of shell scripting.please help me how can i seperate a string in two parts.eg.user given sting is"oi2ehello".i want to make 2 string string1=oi2e and string2=hello

Last edited by arghya_owen; 05-12-2008 at 06:22 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 05-12-2008
Registered User
 

Join Date: Jul 2006
Posts: 189
Code:
var=testing
echo ${#var}
Reply With Quote
  #3  
Old 05-12-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Code:
#!/bin/ksh
> var="oi2ehello"
> echo "${var%%????}  ${var##????}" | read var1 var2
> echo $var1 $var2
oi2eh hello
Reply With Quote
  #4  
Old 05-14-2008
Registered User
 

Join Date: May 2008
Posts: 29
thanks a lot.....
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0