From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26767 invoked by alias); 17 Aug 2015 12:06:54 -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: 20424 Received: (qmail 28832 invoked from network); 17 Aug 2015 12:06:52 -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-Biglobe-Sender: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: translate all sequences of whitespace/underscores to single dashes From: "Jun T." In-Reply-To: <20150817094752.53c314fe@pwslap01u.europe.root.pri> Date: Mon, 17 Aug 2015 20:27:22 +0900 Content-Transfer-Encoding: 7bit Message-Id: <9D99B267-5DDD-4C5B-A33A-C5A0251A4B9F@kba.biglobe.ne.jp> References: <87r3n2dav7.fsf@nl106-137-147.student.uu.se> <20150817094752.53c314fe@pwslap01u.europe.root.pri> To: zsh-users@zsh.org X-Mailer: Apple Mail (2.1878.6) X-Biglobe-Spnum: 57648 In theory, if we want the same effect as the original code (which uses 'tr -s "-"'), we need ${x//[-_[:space:]]##/-} so that x='a_-_z' becomes 'a-z' (not 'a---z'). BTW, the line mv $f $new_name 2> /dev/null in the function clean-filename() is dangerous, because two files $f can have the same $new_name, in which case one of them is lost (or $new_name may already exist before the function is called). # If http://user.it.uu.se/~embe8573/conf/.zsh/files-fs is just a # simplified version and you already have a correct handling of # the problem then please forget this note.