From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from trout.nosc.mil ([128.49.16.7]) by hawkwind.utcs.toronto.edu with SMTP id <2688>; Mon, 16 Aug 1993 12:19:25 -0400 Received: from schroeder.nosc.mil by trout.nosc.mil (5.59/1.27) id AA16787; Mon, 16 Aug 93 09:19:09 PDT Message-Id: <9308161619.AA16787@trout.nosc.mil> Received: by peanuts.nosc.mil; Mon, 16 Aug 93 09:19:04 PDT Date: Mon, 16 Aug 1993 12:19:04 -0400 From: broman@peanuts.nosc.mil (Vincent Broman) To: rc@hawkwind.utcs.toronto.edu Subject: How to edit filenames in rc scripts without sed Reply-To: broman@trout.nosc.mil One of the csh features I find useful, and don't know how to emulate easily in rc, is the variable substitution with modifiers. This lets you edit filenames to a certain degree without execing sed all over the place. E.g. undoing patches with: foreach f (*.orig) mv $f $f:r end is nicer than for ( f in *.orig ) mv $f `{echo $f | sed -e 's/\.[a-z]*$//'} I've tried thinking up ways to get this effect by manipulating the IFS to include '.' but I still get `{echo $f| ...stuff... } Any ideas how to do basic filename modifications cleanly in rc? Vincent Broman, code 572 Bayside Phone: +1 619 553 1641 Naval Command Control and Ocean Surveillance Center, RDT&E Div. San Diego, CA 92152-6147, USA Email: broman@nosc.mil