Sponsored Content
Top Forums UNIX for Dummies Questions & Answers check if two files exists at the same time in one location Post 302593587 by kokoro on Friday 27th of January 2012 12:12:11 PM
Old 01-27-2012
check if two files exists at the same time in one location

Hi friends,

I am trying to check if the two files i am expecting are created in a specific location.

if both files does not exist, do an echo
Code:
if [ [ ! -f out1.txt ] -a [ ! -f out2.txt ] ]; then
   echo "files not found"
fi

It gives me the following message:
Code:
bash: [: too many arguments

Please help! Smilie

Last edited by kokoro; 01-27-2012 at 01:13 PM.. Reason: add details
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

copy files from one location to similar location

I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure, say location 1, /home/rick/tmp_files/1-12/00-25/ here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies

2. Shell Programming and Scripting

HOW TO CHECK ONLY .C FILES EXISTS OR NOT IN A FOLDER using IF in C shell script?

Hi friends.. I hav a problem.... I dont know how to check .c files exists r not in a folder using IF in C shell script actually i tried like this if(=~ *.c) even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
Discussion started by: p.hemadrireddy
17 Replies

3. Shell Programming and Scripting

Shell Script for Copy files from one location to another location

Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
Discussion started by: allways4u21
2 Replies

4. Shell Programming and Scripting

Copy Files to Dir and Check If File Exists

Hi everyone. I am trying to write a bash script that will copy files from one directory to another but I need to be able to check the directory that I'm copying the files to and see if the file already exists. If it does I need to add a number at the end of the copied file. Thanks for your help. (3 Replies)
Discussion started by: snag49ers
3 Replies

5. Shell Programming and Scripting

to check files updation in sys time

Dear All, Pls help me on this issue. i want to write a script to check whether files updation happening in cuttent time or not. i have set of files in directory which wil update in time basis.. Requirement: If the files are updating in system time i just want to print "files are... (6 Replies)
Discussion started by: steve2216
6 Replies

6. Shell Programming and Scripting

shell script to replicate the log files from one location to another in real time

Hi, On the server, we have app log files in this location /app/logs/error.log On the same server, in a real time, we would like to replicate that into /var/ directory. if someone has already done this, please share the script. Thanks in advance. (4 Replies)
Discussion started by: lookinginfo
4 Replies

7. Shell Programming and Scripting

check if files exists

i writing a program that checks if any .txt files exist in the current directory if it does, then it lists the files... i have got everything right, except the validation part doesnt work! .... if then ls *.txt else echo "file not found" everytime it tells me file not found!! by... (3 Replies)
Discussion started by: bshell_1214
3 Replies

8. Shell Programming and Scripting

File exists, but cannot be opened.How to check- whether it could be opened to read when it exists

Hi #Testing for file existence if ; then echo 'SCHOOL data is available for processing' else echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING' : i wrote a script, where it begins by checking if file exists or not. If it exists, it truncates the database... (2 Replies)
Discussion started by: rxg
2 Replies

9. Post Here to Contact Site Administrators and Moderators

How to count successfully copy files source to target location with check directory in Linux?

Hi guys...please any one help me .... how to copy files from source to target location if 5 files copied successfully out of 10 files then implement success=10 and if remaining 5 files not copied successfully then count error=5 how to implement this condition with in loop i need code linux... (0 Replies)
Discussion started by: sravanreddy
0 Replies

10. Shell Programming and Scripting

How to check more than 1 file specified files exists?

Hi all, One of my script crated created 2 files in a dirs Output.log and Output.tmp. Now in another script i need to check if both of the above mentioned files are present in a directory or not. I know to check one file but need to check both the files. Anyone could please tell me how... (3 Replies)
Discussion started by: girijajoshi
3 Replies
llc2_autoconfig(1)						   User Commands						llc2_autoconfig(1)

NAME
llc2_autoconfig - generate LLC2 configuration files SYNOPSIS
/usr/lib/llc2/llc2_autoconfig [-f] DESCRIPTION
The llc2_autoconfig utility is used to generate LLC2 configuration files (/etc/llc2/default/llc2.*). If there is no configuration file in /etc/llc2_default/, it detects all the available interfaces in the system and generates corresponding default configuration files. If there are existing configuration files in /etc/llc2_default/, it will check if those interfaces defined in the files still exist. If they do not exist in the system, it will set llc2_on in those files to 0. After this, it will detect if there are new interfaces in the system. If there are, it will generate configuration files for them. OPTIONS
The following option is supported: -f Erases all configuration files in /etc/llc2/default/. Then detects all the available interfaces in the system and generates cor- responding default configuration files. Use this option with caution. FILES
/etc/llc2/default/llc2.* LLC2 configuration files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWllc | +-----------------------------+-----------------------------+ SEE ALSO
llc2_config(1), llc2(4), attributes(5), llc2(7D) SunOS 5.10 18 May 1999 llc2_autoconfig(1)
All times are GMT -4. The time now is 10:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy