Hello
If you do not know the suffix then you cannot use basename.
ksh and bash have string extension which can do the job.
Below are expressions which will work in every shell:
path="`expr "$i" : '\(.*\)/'`" # get file path (if any)
name="`expr "//$i" : '.*/\([^/]*\)'`" # remove path to file
suffix="`expr "$name" : '.*\.\([^./]*\)$'`" # extract last suffix
name="`expr "$name" : '\(.*\)\.[^.]*$'`" # remove last suffix
Pascal
----- Original Message -----
From: "Daniel Staaf" <[EMAIL PROTECTED]>
To: "Development of mythtv" <[email protected]>
Sent: Thursday, August 11, 2005 9:31 PM
Subject: Re: [mythtv] Screenshot Shell Script...
Jochen Kühner skrev:
I've restarted my shellscript to use sh instead of php.
but now i need help,
first, the option to extrat the filename of a path and a extsion. (like
/aa/bb/cc/dd.eee then i need dd)
basename /aa/bb/cc/dd.eee .eee
/ Daniel
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev