The UNIX and Linux Forums  

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



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-16-2007
xiamin xiamin is offline
Registered User
 

Join Date: Aug 2001
Posts: 58
Double Substitution variables in ksh

Hi

I have a variable whose value is like this
i=/test/test1/test2/myfile.cd.070505123457
i would like to have the value of myfile.cd stored into another variable

my attempt is
test=${i##*/} ;echo $test ##and i get
myfile.cd.070505123457

since what i wnat is myfile.cd i try this
test={{${i##*/}}##.} ;echo $test
and i get an error

Any idea how do i get what i want ?

regards
xiamin
Reply With Quote
Remove advertisements
!!
Forum Sponsor