On Tuesday 11/01/11 21:24:02 CST, Michael Graham wrote: > Hi Du Yang, > > Thanks for the above; it fixed the terminal errors, and now I’m running it > without anything being printed to the terminal on exit. > However, it’s *still* not letting me traverse the nested folders using > the browser — I just end up in the top-level folder. I can go there directly > using macros (I have one, ga, set to get me to the current year’s archive > folder). > My .muttrc is now as follows: > > set mbox_type = Maildir > set pager_stop > set folder = "~/.mail" > set spoolfile = "~/.mail/INBOX" > set record = "~/.mail/Sent\ Messages" > set postponed = "~/.mail/Drafts" > set mask = "!^\\.[^.]" > > mailboxes ! + `\ > for file in ~/.mail/.*; do \ > box=$(basename "$file"); \ > if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" = '.customflags' \ > -a ! "$box" = '.subscriptions' ]; then \ > echo -n "\"+$box\" "; \ > fi; \ > done; \ > for folder in ~/.mail/*; do \ > if [ -x $"folder" ]; then \ > box=$(basename "$folder"); \ > for file in ~/.mail/$box/.*; do \ > box2=$(basename "$file"); \ > if [ ! "$box2" = '.' -a ! "$box2" = '..' -a ! "$box2" = > '.customflags' \ > -a ! "$box2" = '.subscriptions' ]; then \ > echo -n "\"+$box/$box2\" "; \ > fi; \ > done; \ > fi; \ > done` > > Any ideas on why I can’t burrow down into the lower-level folders using the > browser? >
Hi Mike, 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 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 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. Which one is you like? or both? Best regards du yang -- oooO::::::::: (..)::::::::: :\.(:::Oooo:: ::\_)::(..):: :::::::)./::: ::::::(_/::::
a.sh
Description: A.SH
b.sh
Description: B.SH
signature.asc
Description: Digital signature
