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 -->
  #5 (permalink)  
Old 06-03-2007
aigles's Avatar
aigles aigles is offline
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,212
find doesn't print directoriy name with a trailing /, so your sed command works only for subdirectories.
Modifify your command

Code:
find /home/"$dir1" -type d -print |
sed "s;^/home/$dir1\(/\|$\);/home/$dir2\1;'" |
while read newdir
Jean-Pierre.
Reply With Quote