On Mon, Jun 23, 2003 at 11:25:37AM +0100, David selby wrote: > In bash how can I split a string eg ... > > var1=0624todaysfile > > I want var2 to equal the first 4 digits, ie 0624 > My first instinct was cut but this is for files only, head & tail are of > no use ... zsh % echo $A | cut -c 5-14 todaysfile 03-06-23 12:58:03 [EMAIL PROTECTED] /tmp zsh % echo $A | cut -c 1-4 0624
Regards Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch "There is therefore now no condemnation to them which are in Christ Jesus, who walk not after the flesh, but after the Spirit." Romans 8:1 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]