zsh-users
 help / color / mirror / code / Atom feed
* more fun with parameter expansion
@ 2000-06-16 18:53 Clint Adams
  2000-06-16 19:54 ` Clint Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Clint Adams @ 2000-06-16 18:53 UTC (permalink / raw)
  To: zsh-users

This is for someone who wants to take a directory tree and convert all
the filenames (and directory names) to lowercase, replacing spaces
with underscores.  It presumes that you are using GNU mv and have
MARK_DIRS set.  I'm sure that someone can make it more efficient.

for i (*(/N)) {mv -v "$i" "${(L)i:gs/ /_/}"}
for i (*/**/*(/N)) {mv -v "${${(L)i%/*/}:gs/ /_/}/${${${i#*/}%/}##*/}" "${(L)i:gfor i (**/*(N^/)) {mv -v "${i}" "${(L)i:gs/ /_/}"}


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2000-06-19 15:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-16 18:53 more fun with parameter expansion Clint Adams
2000-06-16 19:54 ` Clint Adams
2000-06-16 21:00 ` Bart Schaefer
2000-06-16 21:44   ` Bart Schaefer
2000-06-17  1:17     ` Clint Adams
2000-06-18 22:02 ` Peter Stephenson
2000-06-19  9:08   ` Peter Stephenson
2000-06-19 15:21     ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).