Sponsored Content
Top Forums Shell Programming and Scripting checking textfile exists or not in all directories Post 302241293 by nua7 on Monday 29th of September 2008 03:53:51 AM
Old 09-29-2008
Please post, whatever you have tried..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Please help me with this script meant for checking /etc/passwd if a name exists

I'm trying to create a program that includes variety of duties. One of the duties includes deleting a user if the user name exist in the /etc/passwd file. how do i make that happen. those of you that know about this shell programming, please tell me what i should do after the shell reads... (4 Replies)
Discussion started by: TRUEST
4 Replies

2. IP Networking

checking a connection still exists?

Hi I have a bit of c code which I'm trying to use as a relay between apache and a scgi cluster. Example of problem code is below: while((n = recv(scgiSock, local_data, MAX_LENGTH, 0)) > 0) { time(&t2); time_now = t2 - t1; if(time_now > TIMEOUT) ... (2 Replies)
Discussion started by: fishman2001
2 Replies

3. Shell Programming and Scripting

Checking the file if it exists

Hi This will be useful who is looking for checking the files in a directory #chmod 777 /cronacle/tools/teradata/opo/bin/file_check.sh SUBJECT=`echo "File Not Found"` SUBJECT1=`echo "File Found"` #RECIPIENT=Madhu.Reddy@ge.com cd /cronacle/tools/teradata/opo/bin file_list=attach.sh if ... (3 Replies)
Discussion started by: ksmbabu
3 Replies

4. Shell Programming and Scripting

Checking if a file exists

How can I check if a file exists in shell script. Basically, I want to check if a file Test_msgs has been created today. If it has been then append data to it. Otherwise, create it. I have written the following but it does not work. todaysdate=$(date +%d%m%Y) timenow=$(date +%H%M%S)... (4 Replies)
Discussion started by: gugs
4 Replies

5. Shell Programming and Scripting

Checking if file exists

How can I check if a file exists in csh? I know there is "-e $file" but do not know exactly how to use it. I have tried the below but I'm getting "Bad : modifier in $ ( )." foreach f ($AfullnameLst) if (-e $f) then echo "$f: file exists" endif end (6 Replies)
Discussion started by: kristinu
6 Replies

6. Shell Programming and Scripting

what is the difference between -f and -e, when checking for file exists

Hi All, what is the difference between -f and -e. Regards, ch33ry (1 Reply)
Discussion started by: ch33ry
1 Replies

7. Shell Programming and Scripting

Checking whether the file exists under a directory and doing a diff

Hi Everyone, I am writing a shell script for the below needs and would like your suggestions and advices. I have a lot of scripting files(Shell Scripts) under the directory: /home/risk_dev/dev I have another directory which has a lot of shell scripts under the directory: ... (2 Replies)
Discussion started by: filter
2 Replies

8. Shell Programming and Scripting

Checking if file exists and unzipping

Hey, I am new to scripting and was wondering what is wrong with this if statement. I want to check if file exists and the if it does to unzip it. I program it as follows if ; then gunzip *_filename.gz fi Thanks in advance! Please use code tags next time for your code and data. (10 Replies)
Discussion started by: mostarac2487
10 Replies

9. Shell Programming and Scripting

For loop without checking file exists

In several scripts that process files matched by name pattern I needed to add a check for file existence. Just to illustrate let's say I need to process all N??? files: /tmp$ touch N100 N101 /tmp$ l ?10 -rw-rw-r-- 1 moss group 0 Apr 19 11:22 N100 -rw-rw-r-- 1 moss group ... (10 Replies)
Discussion started by: migurus
10 Replies

10. UNIX for Beginners Questions & Answers

Code for checking if certain no of files exists

Hi, I am writing the shell script in ksh to check certain no of files exists,In my case there are 7 files exist like below Sales1_timstamp.csv Sales2_timstamp.csv Sales3_timstamp.csv Sales4_timstamp.csv Sales5_timstamp.csv Sales7_timstamp.csv Sales7_timstamp.csv Once all the files... (4 Replies)
Discussion started by: SRPR
4 Replies
install(1M)															       install(1M)

NAME
install - install commands SYNOPSIS
dira] dirb] dirc] group] user] file [dirx ...] DESCRIPTION
is a command most commonly used in ``makefiles'' (see make(1)) to install a file (updated target file) in a specific place within a file system. Each file is installed by copying it into the appropriate directory, thereby retaining the mode and owner of the original command. The program prints messages telling the user exactly what files it is replacing or creating and where they are going. is useful for installing new commands, or new versions of existing commands, in the standard directories (i.e. etc.). If no options or directories (dirx...) are given, searches a set of default directories and in that order) for a file with the same name as file. When the first occurrence is found, issues a message saying that it is overwriting that file with file (the new version), and proceeds to do so. If the file is not found, the program states this and exits without further action. If one or more directories (dirx ...) are specified after file, those directories are searched before the directories specified in the default list. Options Options are interpreted as follows: Installs a new command (file) in the directory specified by dira, only if it is not found. If it is found, issues a message saying that the file already exists, and exits without overwriting it. Can be used alone or with the option. Forces file to be installed in given directory, whether or not one already exists. If the file being installed does not already exist, the mode and owner of the new file will be set to and respectively. If the file already exists, the mode and owner will be that of the already existing file. Can be used alone or with the or options. Ignores default directory list, searching only through the given directories (dirx ...). Can be used alone or with any other options other than and If file is not found in any of the searched directories, it is put in the directory specified in dirc. The mode and owner of the new file will be set to and respectively. Can be used alone or with any other options other than and If file is found, this option saves the ``found'' file by copying it to in the directory in which it was found. This option is useful when installing a normally busy text file such as or where the existing file cannot be removed. Can be used alone or with any other options other than Causes file to be owned by group group. This option is available only to users who have appropriate privileges. Can be used alone or with any other option. Causes file to be owned by user user. This option is available only to users who have appropriate privileges. Can be used alone or with any other option. Suppresses printing of messages other than error messages. Can be used alone or with any other options. When no directories are specified (dirx ...), or when file cannot be placed in one of the directories specified, checks for the existence of the file If exists, it is used to determine the final destination of file. If does not exist, the default directory list is further scanned to determine where file is to be located. The file contains a list of absolute pathnames, one per line. The pathname is the "official" destination (for example of the file as it appears on a file system. The file serves as a master list for system command destinations. If there is no entry for file in the file the default directory list is further scanned to determine where file is to be located. Cross Generation The environment variable is used to locate the locations file (in the form This is necessary in cases where cross generation is being done on a production system. Furthermore, each pathname in is appended to (for example, and used as the destination for file. Also, the default directories are also appended to so that the default directories are actually and The file does not exist on a distribution tape; it is created and used by local sites. WARNINGS
cannot create alias links for a command (for example, vi(1) is an alias link for ex(1)). SEE ALSO
make(1), cpset(1M). install(1M)
All times are GMT -4. The time now is 02:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy