On Wed, Nov 02, 2011 at 05:10, du yang wrote: Hi Du Yang,
> There is minor error in your script. > > The if condition's syntax is incorrect, it should be like as writing below. > (Note the quote mark position.) > > if [ -x "$folder" ]; then I’ll make that change and see if it works. > The intention of the script is to generate first level mailboxes start > with '.' as well as the sub-level mailboxes(mbox or maildir) which starts > with '.'(except > '.', '..', '.customflags', '.subscriptions'). > > Note to show the sub-level mailboxes it requires the first level folder > not start with '.'. Is this you want? I don’t really mind whether the first-level folder starts with a ‘.’ or not; I only chose “.mail” so it would keep my Finder a little tidier. > I have some tests with the script. there is a maildir folder structure > created as below, > > # find .maildir/ > .maildir/ > .maildir/list > .maildir/list/.c > .maildir/list/.a > .maildir/list/.b > .maildir/inbox > .maildir/.mbox > .maildir/.list > .maildir/.list/.c > .maildir/.list/.a > .maildir/.list/.b > > > # ./a.sh > "+.list" "+.mbox" "+list/.a" "+list/.b" "+list/.c" > > # ./b.sh > "+.list" "+.mbox" "+.list/.a" "+.list/.b" "+.list/.c" > > The a.sh's result should be the author's expectation. the b.sh is assume > that the first level folder starts with '.' when showing sub-level mailboxes. > Both of them are attached. None of my sublevel mailboxes start with a ‘.’ — they’re just regular mailboxes. A quick ls shows: drwx------ 7 mike 238B 31 Oct 18:58 Accounts/ drwx------ 5 mike 170B 31 Oct 18:58 Archive/ drwx------ 14 mike 476B 31 Oct 18:58 Archives/ drwx------ 5 mike 170B 31 Oct 18:58 Deleted Messages/ <snip> Is that where my problem is? Should I force offlineimap to generate sublevel mailboxes that start ‘.’? Thanks once again for all your help, Mike -- __ __ __ / /_____ _______ _/ /__ _/ /____ _ __ / '_/ _ \/ __/ _ `/ / _ `/ __/ _ \ |/ / Raconteur, Mostly /_/\_\\___/_/ \_,_/_/\_,_/\__/\___/___/ <http://koralatov.com/>