The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
what is the right syntax ??
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
what is the right syntax ??
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
06-03-2007
aigles
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.
aigles
View Public Profile
Find all posts by aigles