forget it.. stupid questions…… mistake the \ to /
just use
Code:
find /mnt/us/documents -type d |grep -v "/mnt/us/documents$" | grep -v "\.sdr$" | grep -v "^$" | grep -v "/mnt/us/documents/Gallery/" | grep -v "/mnt/us/documents/Gallery$" | sed "s/^\/mnt\/us\/documents\///g" | sed "s/\//-/g" | while read dir; do
and all works fine
Quote:
Originally Posted by dir194
I'm using the sync extension,somehow the change doesn't work,it still add sub dir for Gallery as collection,so I look into the file.
I found it hard to understand what the "\" in "grep -v "\Gallery$" means, since the "\" already change to "-" in the previous sed procedure.
(also the \.sdr$  )
I try to change it to my more familiar form:
grep -v "/mnt/us/documents/Gallery/" | grep -v "/mnt/us/documents/Gallery$" and put all grep -v before the sed procedure
it works for me,and should be little bit faster too.
|