Hi, On 29/12/14 19:03, Yamaban wrote:
On Mon, 29 Dec 2014 17:42, Hylton Conacher (ZR1HPC)
wrote: Hi,
I am endeavouring to print a list of my Maildir folders to a file so that I can use that same list when I construct a Procmailrc file.
Initially I ran ~> find $HOME/Maildir -type d -print | sort > /home/hylton/maillistdir
**sample snip*** /home/hylton/Maildir/.INBOX.A-F.Bookstores.Kalahari /home/hylton/Maildir/.INBOX.A-F.Bookstores.Kalahari/courierimapkeywords /home/hylton/Maildir/.INBOX.A-F.Bookstores.Kalahari/cur /home/hylton/Maildir/.INBOX.A-F.Bookstores.Kalahari/new /home/hylton/Maildir/.INBOX.A-F.Bookstores.Kalahari/tmp ********
I noticed that there were many sub-folders I did not need. Given this list ended up being 273pg, after a short stint at editing it I decided there had to be a way to exclude certain folders.
What I need is the namesand paths of the folders ie /home/hylton/Maildir/.INBOX.A-F.Bookstores.Kalahari
, not the /cur, /tmp, /new or even the /courierimapkeywords sub-folders.
So far I have:
~> find $HOME/Maildir -type d \( ! -name tmp \) -o \( ! -name cur \) -o \( ! -name new \) -o \( ! -name courierimapkeywords \) | -print | sort > /home/hylton/maillistdir
Please do yourself a favior and use more simple than less and thus more complex tools. Grep is your friend.
[code] find $HOME/Maildir -type d -print|\ grep -Ev '/(courierimapkeywords|cur|new|tmp)$' |\ sort > /home/hylton/maillistdir [/code]
Thank you. I was thinking of nesting the various folders I want to exclude in a grep query. Unfortunately although I used your code: :~> find $HOME/Maildir -type d -print|\grep -Ev `/{courierimapkaeywords|new|tmp|cur)$' |\sort > /home/hylton/maillistdir it only gave me a > and seemed to be waiting input whereas all te others have just completed and returned me to a $> prompt? What is it waiting for Tnx Hylton -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org