|
|
Why does no-one use zsh???
It's free and open source, it's supplied as part of Mac OS X, it does pretty much all that ksh and bash do (in fact it can pretend to be ksh), and it has really cool features like recursive file completion which can turn that rather unwieldy
find /path/to/folder/* -type f -mtime +90 -exec rm -f {} ;command into the rather simpler rm -f /path/to/folder/**/*(.m+90)command. (The ** means to search subdirectories recursively, the . includes only plain files, and the m+90 includes only files with a modification time more than 90 days before now.) It can do far more than that, of course, but this is a rather good example. (I should point out that I didn't have to look anything up; the common criteria are fairly easy to remember, and when I tried that command just now it worked first time.) Recursive file completion (the ** bit) seems like such a no-brainer that I'm still amazed the more common shells haven't copied it yet. I don't think I've used find once since I found out about it, as it can do all of that and more -- and because it's right there in the shell, you can use it in really powerful ways. You can run zsh by name at any command prompt, and you can set it as your default shell in NetInfo Manager or (if it still works) the chsh command. ---
Why does no-one use zsh???
The recursive directories do work in bash and csh, but not the modifier
(.m+90). That appears to be a zsh only construct. But you can use it in an automator by entering the command as:
Note that the quotes are necessary to prevent the current shell from trying to interpret the path.
Why does no-one use zsh???
Excellent! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.35 seconds |
|