[wplug] Checking the extension of a file in a shell script

Eric Cooper ecc at cmu.edu
Fri May 12 16:07:20 EDT 2006


On Fri, May 12, 2006 at 03:53:17PM -0400, O'Connor, Michael P. wrote:

> Does any one know how to check for a final character on a string
> (lets call it $file) I want to look to see if the last 2 chars are
> ".C" this is csh,

Check if "$file:e" (the extension) is equal to "C".

-- 
Eric Cooper             e c c @ c m u . e d u


More information about the wplug mailing list