Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh tips plea (tip of the day)

On Friday, July 23, 2004, at 07:39 AM, Joakim Ryden wrote:

Peter Stephenson wrote:

zzapper wrote:

As this group's been a bit quiet lately, my plea would be for you experts to occasionally post a tip, or explain some aspect of zsh.

The usual way of getting these is to post questions...

OK - here's a question... ;) What's a really cool thing you have done with zsh recently? Or if you will... a few lines about "how I was able to solve my issue using zsh" (yes, I was a high school teacher in a previous life).

This isn't really recent, but probably the most common thing I do in zsh that can't be done anywhere else is use the advanced globbing stuff. For instance, I have a (fairly large) directory tree that I use to categorize and store incoming files that need to be processed, after which they get moved to archival directories through symlinks located in each "leaf" directory. Determining whether I have any files waiting for processing thus involves doing a recursive check for plain files only below the root of this tree. In bash, this would either be a significant amount of shell scripting effort or a rather ugly "find" command. (I hate find.) In zsh, it's "ls **/*(.)". Isn't that nice?
    __                      __
   /  )                    /  )
  /--/ __. .__  ______    /  / __. , __o  _  _
 /  (_(_/|_/ (_(_) / (_  (__/_(_/|_\/ <__</_/_)_

Messages sorted by: Reverse Date, Date, Thread, Author