X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B35BF385741D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1635193795; bh=L34wL01fM6G2xQHXs5m2M9lR6DxmtrCuaR7rd8kgSdw=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hf4oSmiAP3OrsflLRKUm37ETOFJ+2F76A0pzIn/CKCS3HR4Z8+RQrzLkDAmLZhO4O aN86qCyfTy8R3qib9WV9hwwENlU8WTK3pAmizFkLCbcdt31wpj26sw/vyeDzKfm3+m 4VpWiHxaGcMygFLCSlS7sVKn/5tD6LK4unvfv2rY= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56D5F385841F ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ng1Xds610ivClItW+/dYHIuQn11s5EKx+OZuIpYH6ibkQQEk6UmqBL4t+12W7DzTFk0Y+dyqYSxxiPRmclgeAlSMAIDeQKRu8RHdTP1b7livWwV4fogI3Ur/GU7njE5Uaym8DpPDmy+02OacJqR7FlNWkHMArj9B4oOxJCyPExSuG5T5FBgL/+hixqXqyYO4U8yspgB6c41sOWr8StiqfL/pt14VH1IoC1wUW1nmh119rM/KUVRKWAzs0wVtjLv2NrNVGnNCMDsHBSryYAd6vHUWjX32OIYVC1xeYD/E27cON0KcdKyoSNExdVkFdKXOw/sdtgQp2P0/uab/9UJ7cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OJW7WdXMcvFlSAQ/TxA1ThDvC87OCdMkHfA6R0AAb1o=; b=YNuyRusdSfIsY65mxP9FByAiSf1lQ85VZMAEUw/MCl2LsjbQDJ9WK4CPdUrvsHVSP9If9BHQ06FrtoRAEcib5QI4jkcpB5R6FlSwPSQwO4ggJ45jrMxLZGPCDV3213XQUW645yoauFMkz1gbtZCo8VEnnE2wrsFbzUCcu9m8yEiDFCW59+RtigqyQXC4GJOOHrFaLynMPrPtc0tXuQVMQ1lllVgppfe+Iv+3Dge4CEGp377/p4K2z5TmiKVdN3EGKTltNQfFYMMBUpcom9FxBjeOi0Z4QMITwTZFZmtIeS/cKuWV2Dr4c6bP5u/5pXdaaeiTw7CGwkZWm897et0LFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none To: "'cygwin AT cygwin DOT com'" Subject: RE: rename using regexpr - is it possible? Thread-Topic: rename using regexpr - is it possible? Thread-Index: AdfIuUOso9jNYEzLT3q4kBenkCDOzgABlNuAAAvY6MAAALCBgAA63rKw Date: Mon, 25 Oct 2021 20:29:20 +0000 Message-ID: References: <1edc0f18-60e9-8769-e931-2875e910cb9e AT cs DOT umass DOT edu> <9b435ec1-7920-4ae4-8867-38913e4bebac AT cs DOT umass DOT edu> In-Reply-To: <9b435ec1-7920-4ae4-8867-38913e4bebac@cs.umass.edu> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [hqR1sA86Ky9XA1ZT6txea8YcbkqIkL3r] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 44eef97f-d867-4550-eb1d-08d997f61ff4 x-ms-traffictypediagnostic: DB7PR03MB4140: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RYGyeuw1Mx3C3digtwIB/1n6pWiYmfOlnI+A2NyHbs8JcLdE4gC/8Idn+Fi1jJsRdQhTD0ObvkzEmslKYUdYmjw6TK8LGZo7hbmrayZX5JO04hpc6UUjXMoerjCWGfuOa8mAEfsFj4sFV5hXruuQtztjZAJTtdQLWrDQaqof8jw9fNn6wgquOidaiq9wJWBdiz8JtFyYLUpzvZ/u9PrWYw07H72kZlDHBahcdg9cGPIjyElPfM67tHW3nzsZak7bS5qV+etU+f8eNLikM27kNwxKejHltvTsU6fequ0WX6sqvsJVx8V3vAliSiYvWUKhcZQje5swGKg0OA8SVCjvJnJQO+ZjfPVbY75BJLWSQadqzafs+6JhS6E9IAUqyuaLK6I0QeQEy5neFClrZw9/gudeZqT0lDdI1nII/U9rpZ0jBggbN7WxBoNZGxnXkqRE82RD8HEYOk8T07/SEfAgop4b968+dBbAlm/ABXJWWMH/j/CRkJc7MaxhQHWOtruE+788HKI57Sio6VxCvoK3ivJhDmIJCzl1Cg06U+AYHaY= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: zGGH5EDJcbhL8lUxoDBuj0KnOOKhtRguHTKOI/yQ01f4crbdKUDRScx+GcxGETOHV5smXNBlBDb3Lm9UKtC4HmfaMolHXqM9SY5s+t8mQ4oYPga5ld9C2kkeXJ0S2nN5LLII7/BuSt7jgATlXvHGGLbBS/CtJ6Wl4yEOLOxNv4Xohmph53X/WKpFNuGrdWYDpBubXqJSdnXINDjtofCSOnwWnaahwFweAnGXVIYuJv222rzVlE9E1vGGB4EnM6zwyG+9OXgUXtd/DD5o8VDBFmW67TXlGGwuuQPY3clCl0pNlKvUmdJKNuSzD+FNH2EQ6h63ADMpnyzvgHbTYVZI88KrhnqLJZx260YtoGC6NIVpLYB4+hjWeVu2KY0ziSo6f0PorrbIZH/NhAPnKljQ3z2Q2/T4HcQDG6p5yBBMWVcg7EjSwuHM+iEDgIizlfurz1SdOFvzEiK5b/pB8aaymvhqA8z2taiouQY4sPdWF4K9ISlktyVrdUsVy3KNJgUJuceVNp7fPuMZfmQcGtWhRAimZJrwSsb2b+C957U6Zzrm+duaVvsabElc79DpYLHRNk2WGLRbIyV/qhNtI8SCgZqCpUxWJZDQfFyXt7PIFHSEfm+UlqLX77RkrRMOTQikPXRBpyxbAh7j/WHA6+fxdtVjJmX7sVvby9i6iMk5wG/0uc8JzikDYEimMe7T43lGJGk4NmdWO7/qc/s/v9ZhHw== MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB6PR03MB3013.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 44eef97f-d867-4550-eb1d-08d997f61ff4 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Oct 2021 20:29:20.1860 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB4140 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Fergus Daly via Cygwin Reply-To: Fergus Daly Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" -----Original Message----- From: Eliot Moss Sent: 24 October 2021 17:11 To: Fergus Daly ; 'cygwin AT cygwin DOT com' Subject: Re: rename using regexpr - is it possible? On 10/24/2021 4:55 PM, Fergus Daly wrote: >>> I might be wrong but: >>> The Cygwin implementation of rename seems completely different from "the" (my) Linux version. >>> (Almost unique? Otherwise the matching in Cygwin of all syntax - >>> vocab, switches, outcomes - to Linux, seems almost perfect.) Can I >>> rename a set of files *.d (say) as filename.d -> XXfilename.d? >>> In Linux this would be achieved by >>> $ rename 's/^/XX/g' ./*.d >>> whereas in Cygwin >>> $ rename ^ XX *.d >>> (and all similar attempts) fails. >>> Thank you. > >> You're confusing perl-rename with util-linu rename. >> The former, which seems to be what you want, can be installed using >> cpan (install File::Rename), assuming you have perl installed. >> It will put its rename command in /usr/local/bin, presumably taking precedence over the util-linux one in /usr/bin. >> It further seems that "normally" these two have different names, like >> rename.ul and prename, and /etc/alternatives is used to set up the rename command. >> This required some web searching to determine ... >> Cheers - Eliot > > Perfect. Worked like a dream. > All in place, and naming managed. > Thanks so much. No problem - learned something myself! EM PS When I said .. .. > Perfect. Worked like a dream .. .. I had only tried things in Cygwin32. The cpan step failed in Cygwin64 so I couldn't follow up with the install File::Rename command. (I'm quite surprised. Here, the Cygwin32 and Cygwin64 setups are identical in that, whilst incomplete i.e. not "Full", they are constructed using the identical C:> setup -P {long list of packages separated by commas} command at the Windows prompt. Up to now they have behaved identically. Solved by copying across from Cygwin32 to Cygwin64 all the newly "rename-augmented" files under /usr/local/bin/, /usr/local/lib/, /usr/local/man/, and not forgetting the augmented file /etc/bash.bashrc containing the 4 export perl* lines. Seems to work so far. But if I hadn't also got Cygwin32, I would have been stuck with the cpan failure under Cygwin64. I must have missed something for Cygwin64 .. .. but Goodness knows what. -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple