[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash: how to split a $var ?



Boukhaïri wrote:

what about tr ?

David selby wrote:

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 ...

Many thanks
Dave


Many thanks everyone, still a learner with respect to bash, your help is
appreciated
Dave


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


tr - translate or delete characters ... yet another utility I had no idea existed ! ...
Dave







Reply to: