Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!ken From: ken@cs.rochester.edu (Ken Yap) Newsgroups: comp.unix.questions Subject: Re: Wildcard expressions from the command line. Message-ID: <1990Jan5.061043.17339@cs.rochester.edu> Date: 5 Jan 90 06:10:43 GMT References: <569@auto-trol.UUCP> Reply-To: ken@cs.rochester.edu Distribution: usa Organization: University of Rochester Computer Science Department Lines: 13 Address: Rochester, NY 14627, (716) 275-1448 |The problem is that this syntax cannot be used on the command line. This is |needed to be able to perform wildcard file manipulation. For example, if I |want to copy all files with a ".ftn" extension to a ".for" extension, how can |I copy these without writing a special shell script? If I could use the "ed" |regular wildcard expression, it would look like this: | | cp \(*\).ftn \1.for | |Is there any way to do this from the command line? Ah, my favourite example of using sh in a pipeline: ls *.ftn | sed 's/\(.*\).ftn/cp & \1.for/' | sh