View Single Post
Old 03-06-2012, 09:37 AM   #66
dir194
Member
dir194 began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Jan 2012
Device: kindle touch
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 View Post
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.
dir194 is offline