|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi. I'm writing a Bourne shell script. If I have these file path
strings: root1="dir1/dir2/" root2="dir3/dir4/" I want to be able to take a path under root1 and make a string that points to the same path under root2. For example: Given "dir1/dir2/dirA/dirB", I'd like to change this to "dir3/dir4/dirA/dirB". Any suggestions would be greatly appreciated! Thanks, Ken |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
kk_oop@yahoo.com wrote:
> Hi. I'm writing a Bourne shell script. If I have these file path > strings: > > root1="dir1/dir2/" > > root2="dir3/dir4/" > > I want to be able to take a path under root1 and make a string that > points to the same path under root2. For example: > > Given "dir1/dir2/dirA/dirB", I'd like to change this to > "dir3/dir4/dirA/dirB". echo "dir1/dir2/dirA/dirB" | sed "s?$root1?$root2?" Ed. |
|
![]() |
| Outils de la discussion | |
|
|