Friday, June 17, 2005

Strip off file extension

${filename%.*}


Example:
$ filename="Foo.java"
$ echo ${filename%.java}
Foo



Or

$ filename=$(basename Foo.java .java)

0 Comments:

Post a Comment

<< Home