From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4221 invoked by alias); 17 Aug 2015 14:51:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20426 Received: (qmail 2509 invoked from network); 17 Aug 2015 14:51:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=fNiraHw7zgiV2tGAtwH1d+1rh8yuLSeZ7Vr3vtT6An8=; b=ivx7WeU8xM4x63TN35PWV89JfsyX9CkbuHuXHzCUIa6HsNJ6u1lZ6XKjjm+b1ZYJ65 v4plzm3OogU+jdFTtIQ2+2nxQRfoPzf4a5aFGtVtjhBAtV4PjtoN/gDemsHy0L67jkIK z+GyV4GfDztL+OhDY78fYu+tIBRJqDnfC7ZwOiwHDNHzjuWnCJNh3hmLy7UBFGzTOPWG yoIyoGyhaZ8ZNfcQXCZfQ2twMyJ3mnGmoaPzoCiBHmvI5t8hJVXUTZ4r1l4gadxpTp0Z 3UP6tguEQp/1x7YoF8F13lzbjgkZM+NprlkuldbOu5G6yBuXUL9VQoMKEctOntlM8SMp ltTw== X-Gm-Message-State: ALoCoQls7ByWNQzb+NhWNJrBbtmESBQemBxDyFsEAwi1m6FDnWo3lM2eGHGXymW/ePaSDsmEBSsy X-Received: by 10.202.226.17 with SMTP id z17mr1485102oig.16.1439823106332; Mon, 17 Aug 2015 07:51:46 -0700 (PDT) From: Bart Schaefer Message-Id: <150817075142.ZM14700@torch.brasslantern.com> Date: Mon, 17 Aug 2015 07:51:42 -0700 In-Reply-To: <20150817121939.GA6930@chaz.gmail.com> Comments: In reply to Stephane Chazelas "Re: translate all sequences of whitespace/underscores to single dashes" (Aug 17, 1:19pm) References: <87r3n2dav7.fsf@nl106-137-147.student.uu.se> <20150817094752.53c314fe@pwslap01u.europe.root.pri> <9D99B267-5DDD-4C5B-A33A-C5A0251A4B9F__19706.0165032328$1439813299$gmane$org@kba.biglobe.ne.jp> <20150817121939.GA6930@chaz.gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: translate all sequences of whitespace/underscores to single dashes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 17, 1:19pm, Stephane Chazelas wrote: } Subject: Re: translate all sequences of whitespace/underscores to single d } } 2015-08-17 20:27:22 +0900, Jun T.: } > BTW, the line } > mv $f $new_name 2> /dev/null } > in the function clean-filename() is dangerous } } Note that zmv accounts for that (and also adds the missing } "--") (and turns on extendedglob). } } zmv '*' '${f//[-_[:space:]]##/-}' Two additional points: (1) The $f in Jun's warning has nothing to do with the the $f in Stephane's example except that they coincidentally both were used as a variable holding a file name. (2) That use of $f in zmv is explained in the comments in the zmv source file, but isn't mentioned in the man pages / info docs.