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

O'Connor, Michael P. mpoconnor at switch.com
Fri May 12 16:11:10 EDT 2006


Thanks that worked perfectly.

Michael P. O'Connor
US&S 
Office: 412-688-2491 
Cell: 412-498-0667
mpoconnor at switch.com

-----Original Message-----
From: wplug-bounces+mpoconnor=switch.com at wplug.org
[mailto:wplug-bounces+mpoconnor=switch.com at wplug.org] On Behalf Of Eric
Cooper
Sent: Friday, May 12, 2006 4:07 PM
To: wplug at wplug.org
Subject: Re: [wplug] Checking the extension of a file in a shell script

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
_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug



More information about the wplug mailing list