OT: Shell script

Philip Hallstrom freebsd at philip.pjkh.com
Mon Jul 11 18:58:05 GMT 2005


> All,
>
> I am trying to write an SH script that i need some functionality.
>
> I want it to be able to get a filename without the extention on the end.
>
> for example.
>
> file.mp3
>
> i would like it to return 'file'.

Probably lots of ways.

Use sed in a pipe...

sed 's/\....$//'

-philip


More information about the freebsd-questions mailing list