Solved

How to test for file existence in C shell script.

Posted on 1997-04-04
1
188 Views
Last Modified: 2013-12-26
What is the syntax for the If statement when testing for the
existence of a file in a C shell script?
e.g. in Korn Shell, if test -f $filename then....
How is this done in C Shell?
0
Comment
Question by:Beaker040497
1 Comment
 

Accepted Solution

by:
dominus earned 50 total points
ID: 1292518
Use

if ({ test -f $filename }) then
   ...
else
   ...
endif

The white space is important here---don't omit the space
after $filename.

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now