![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| replace *.sqc files with *.sqC extension | rameshonline | Shell Programming and Scripting | 7 | 06-05-2009 04:07 AM |
| How to get files with a specific extension | janavenki | Shell Programming and Scripting | 9 | 11-27-2007 08:56 PM |
| Feedback: Allow tar.gz extension for files | DukeNuke2 | Post Here to Contact Site Administrators and Moderators | 2 | 08-29-2007 02:22 PM |
| finding duplicate files by size and finding pattern matching and its count | jerome Sukumar | Shell Programming and Scripting | 2 | 12-01-2006 04:20 AM |
| How to list files will no extension | Wing m. Cheng | UNIX for Dummies Questions & Answers | 5 | 02-22-2002 02:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
CSH - finding files with the same file extension
Hey,
I'm having a problem finding out if a directory holds any files with a certain file extension, for example .txt. I have tried: HTML Code:
if (! -e "*.txt") HTML Code:
set FILES=`ls *`
echo "Found $FILES"
foreach FILE ($FILES)
if($FILE == "*.txt")
|
|
||||
|
I am trying to check if there is a txt file within a directory, and if ther is I need to do one thing, and if there isn't I need to do something else.
I have tried the code sample and it works I can now use the returning value within a variable and compare this in an if statement. Thank you for your help! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|