From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65799 invoked by alias); 28 Feb 2020 19:52:41 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 65792 invoked by uid 89); 28 Feb 2020 19:52:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=H*f:sk:AM6PR03, H*f:sk:CAD8GWs, H*f:sk:ntqMF7k, H*i:sk:CAD8GWs X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Feb 2020 19:52:39 +0000 Received: from [192.168.1.114] ([24.64.172.44]) by shaw.ca with ESMTP id 7lgZjUkQJnCig7lgajaAqw; Fri, 28 Feb 2020 12:52:36 -0700 Reply-To: cygwin@cygwin.com Subject: Re: Has rename syntax changed? To: cygwin@cygwin.com References: From: Brian Inglis Message-ID: <31e0514d-49e9-9aea-fccf-7cc1524c6510@SystematicSw.ab.ca> Date: Fri, 28 Feb 2020 19:52:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00271.txt.bz2 On 2020-02-28 11:09, Lee wrote: > On 2/28/20, Fergus Daly wrote: >> I am almost certain that the command >> $ rename "anything" "AnyThing" *.ext >> would alter the string from lc to uc as shown, anywhere it occurred in any >> filename in *.ext in the current directory. >> What I remember as past behaviour now fails, leaving he filename unaltered. >> (Failure in much the same way as mv would fail if the similar attempt was >> made.) >> (Good old DOS command rename (or the abbreviation ren) used to achieve >> multiple-rename in an easy manner that just eludes bash.) >> Anyway: has something altered (and quite recently, i think), or am I just >> mis-remembering the versatility of the command rename? > > Try it with the '-v' option > > $ rename -v anything AnyThing *.ext > `anything.ext' -> `AnyThing.ext' > `xxanythingxx.ext' -> `xxAnyThingxx.ext' > > $ rename -v AnyThing anything *.exe > rename: *.exe: not accessible: No such file or directory > > $ rename -v AnyThing anything *.ext > `AnyThing.ext' -> `anything.ext' > `xxAnyThingxx.ext' -> `xxanythingxx.ext' This will always depend on the file system interface: DOS ignores case changes as case is not supported, ExFAT/VFAT and everything else preserves case changes, as do most remote file systems, unless the remote is set up case insensitively to check the old and new names and ignore case changes (I've been annoyed by that in the past, normally on proprietary file servers). -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple