[plug] Remove first sp[ac]e in a filename

Trevor Phillips phillips at central.murdoch.edu.au
Thu Jul 12 11:54:45 WST 2001


Colin Muller wrote:
> 
> On Wed, Jul 11, 2001 at 01:54:48PM +0800, Simon Scott wrote:
> 
> >               * You will not have to touch a line of PERL :)
> 
> May I refer you to your earlier note to yourself? :-)

Hmmm, I deleted the earlier posts of this, but if the subject line is to be
taken verbatim, then the solution I'd use would be:

rename 's/ //' filename

Rename is a damn handy utility!! Basically it applies the first parameter as a
regexp to the renaming of any filenames you provide it. This should remove the
first space of a filename. To remove all spaces, you'd use 's/ //g'. (Yes, you
need to know at least a degree of regexp's).

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: CWIS Systems Administrator     -           T.Phillips at murdoch.edu.au : 
| IT Services                       -               Murdoch University | 
 >------------------- Member of the #SAS# & #CFC# --------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /



More information about the plug mailing list