Solved

How to test for file existence in C shell script.

Posted on 1997-04-04
1
191 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 69
substring method in java 1 98
method notes when mouse over in eclipse 5 83
string initialization in java 11 110
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

12 Experts available now in Live!

Get 1:1 Help Now