Quoting in bash aliases

Kirk McElhearn kirklists at wanadoo.fr
Thu Feb 19 04:28:32 PST 2004


The following command replaces Mac line breaks with Unix line breaks:

perl -pi -e 's/\r\n?/\n/g'

I'd like to make an alias in bash, something like:

alias rplc='perl -pi -e 's/\r\n?/\n/g''

But the above doesn't work. I assume it has something to do with quoting.
I've tried double-quotes, escaping the quotes in the perl string and more.

Can anyone tell me how this needs to be quoted to work correctly?

Thanks,
 
 
Kirk
 
        My latest book: How to Do Everything with Mac OS X Panther
                  http://www.mcelhearn.com/htde.html
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 . . . . . . .  kirk at mcelhearn.com | http://www.mcelhearn.com  . . . . . .
 . .  Kirk McElhearn | Chemin de la Lauze | 05600 Guillestre | France  . .



More information about the X-Unix mailing list