in reply to renaming files question

try with the 'cut' command like
`echo 1bn9.pd.cnt | cut -d. f1`
to get the first column and
`echo 1bn9.pd.cnt | cut -d. f3`
to get the last column and merge it of both.
-kulls

Replies are listed 'Best First'.
Re^2: renaming files question
by Tanktalus (Canon) on Jan 06, 2006 at 16:44 UTC

    If you're going to do this in shell, then you can avoid a bit of work:

    $ echo lbn9.pd.cnt | cut -d. -f1,3 lbn9.cnt
    However, since I think you're advocating writing the above in perl (with the backticks), it seems kind of redundant:
    join '.', (split '.', $name)[0,2]
    which avoids all the overhead of forking and execing multiple (2-3) subprocesses. Personally, I find the backticks (or even system in general) to be vastly overused in perl, mostly by people pretending it's the shell rather than using it as perl.