Checking for presence of any files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Checking for presence of any files
# 1  
Old 03-09-2009
Checking for presence of any files

Is there code in Cshell scripting to check for the presence of any files in the current directory (and only the current directory)? I tried:

if (-r *) then ...

but Cshell doesn't like that.

Thanks,

Paul Hudgens
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking for the absence of files

Hi All, I am trying to put a condition to check if two required files are not present in a particular directory and alert accordingly. cd /root F1=sample1 F2=sample2 if ] then echo "One of the files is not present" else echo "Both the files are present" fi Though both F1 and... (7 Replies)
Discussion started by: swasid
7 Replies

2. Shell Programming and Scripting

Identifying presence and name of new file(s)?

I have an HP-UX server that runs a script each night. The script connects to an SFTP server and downloads all xml files (if any are present) from a certain folder, and then deletes the files from the SFTP server. So sometimes it will download a new file, sometimes it will download 2 or 3 new... (4 Replies)
Discussion started by: lupin..the..3rd
4 Replies

3. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

4. Shell Programming and Scripting

checking co-presence of Var. - Shell or Perl

Hey fellas, I've posted this problem a few days back and I received just one post which was in PHP that I have no idea about! (Thanks to DGPickett) It would be so nice if you can help me with this in Shell or Perl. Here is the story: I have a big table with variables and observations. I... (9 Replies)
Discussion started by: @man
9 Replies

5. Shell Programming and Scripting

Checking dir and files!

Hi Guys, I wrote a code which checks for the text and directory. If the path is incorrect than it should echo that particular path not found. I can create a different if statments but I want to do this in just one if statment with the use of "or" (||). I have succssfully executed this code but now... (2 Replies)
Discussion started by: dixits
2 Replies

6. Shell Programming and Scripting

Cross checking two files

i have two files which contains some fields separated by columns as 03/29/1999 08:48:12 02 172.16.114.50 03/29/1999 09:08:00 480 172.16.112.100 Both of the files do have the same format I want the script which will take two such... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

7. Shell Programming and Scripting

Checking for presence of any files

I have tried the following script to check for the presence of any files in a folder: if (-r *) then goto ZipMiscFiles else echo "" echo " No Miscellaneous files found. Exiting program." echo "" exit endif The -r works fine with the wildcard in combo with other... (4 Replies)
Discussion started by: phudgens
4 Replies

8. Shell Programming and Scripting

Checking for the presence of a string within another string

How to check if a string in contained in another string ? Like Whether the String "brown" is contained in "A quick brown fox jumps over a lazy the dog" (1 Reply)
Discussion started by: hidnana
1 Replies

9. Shell Programming and Scripting

checking entries between files

I need to write a script for: I have two files where I need to check entries and sort of compare: file1: data01 data02 data03 data04 data05 . . . data81 file2: /vol/vx/data01 /vol/vx/data02 /vol/vx/data03 /vol/vx/data04 /vol/vx/data05 . (8 Replies)
Discussion started by: za_7565
8 Replies

10. Shell Programming and Scripting

testing for presence of files in ftp

I have a shell script which GETS a file, but I only want to run this script if $FILE exists on the remote host, don't know correct syntax.....please help ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD bin get $FILE rename export.prn export.prn.$TIMESTAMP !cat... (0 Replies)
Discussion started by: walterja
0 Replies
Login or Register to Ask a Question
DH_INSTALLDEB(1)						     Debhelper							  DH_INSTALLDEB(1)

NAME
dh_installdeb - install files into the DEBIAN directory SYNOPSIS
dh_installdeb [debhelperoptions] DESCRIPTION
dh_installdeb is a debhelper program that is responsible for installing files into the DEBIAN directories in package build directories with the correct permissions. FILES
package.postinst package.preinst package.postrm package.prerm These maintainer scripts are installed into the DEBIAN directory. Inside the scripts, the token #DEBHELPER# is replaced with shell script snippets generated by other debhelper commands. package.triggers package.shlibs These control files are installed into the DEBIAN directory. Note that package.shlibs is only installed in compat level 9 and earlier. In compat 10, please use dh_makeshlibs(1). package.conffiles This control file will be installed into the DEBIAN directory. In v3 compatibility mode and higher, all files in the etc/ directory in a package will automatically be flagged as conffiles by this program, so there is no need to list them manually here. package.maintscript Lines in this file correspond to dpkg-maintscript-helper(1) commands and parameters. However, the "maint-script-parameters" should not be included as debhelper will add those automatically. Example: # Correct rm_conffile /etc/obsolete.conf 0.2~ foo # INCORRECT rm_conffile /etc/obsolete.conf 0.2~ foo -- "$@" In compat 10 or later, any shell metacharacters will be escaped, so arbitrary shell code cannot be inserted here. For example, a line such as "mv_conffile /etc/oldconffile /etc/newconffile" will insert maintainer script snippets into all maintainer scripts sufficient to move that conffile. It was also the intention to escape shell metacharacters in previous compat levels. However, it did not work properly and as such it was possible to embed arbitrary shell code in earlier compat levels. The dh_installdeb tool will do some basic validation of some of the commands listed in this file to catch common mistakes. The validation is enabled as a warning since compat 10 and as a hard error in compat 12. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLDEB(1)