Wildcard expressions from the command line.
Ken Yap
ken at cs.rochester.edu
Fri Jan 5 17:10:43 AEST 1990
|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
More information about the Comp.unix.questions
mailing list