[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Multiple files

on Fri, May 31, 2002, Daniel D Jones (ddjones@riddlemaster.org) wrote:
> How does one handle multiple files via most command line utilities?  For
> example, suppose you have a handful of perl scripts (*.pl) and you want
> to save them in the same directory with a different extension.  The
> command
> cp *.pl *.bak
> complains that you're copying multiple files but the last command isn't
> a directory.

    $ man mmv

...though I typically use the 'for' loop others mention.

> Or suppose you have a series of perl scripts which are saved in DOS
> line-end format.  The extra ^M on the bang line causes bash not to
> recognize the path to perl, and the script to fail.  Sounds like a job
> for sed.
> sed s/^M// *.pl > *.unix

dos2unix accepts multiple file arguments, changing files "in place":

    dos2unix *.pl


Karsten M. Self <kmself@ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
   The Consumer Broadband and Digital Television Promotion Act:
     Feinstein's answer to Enron envy.

Attachment: pgpefbXAi191x.pgp
Description: PGP signature

Reply to: