Sponsored Content
Top Forums Shell Programming and Scripting Find a file and if exists , execute a different file Post 302948793 by Don Cragun on Thursday 2nd of July 2015 02:09:32 PM
Old 07-02-2015
Show us the output from the command:
Code:
ls -l /u01/Oracle/services /u01/middleware/stop.sh

From the error message you showed us, I would guess that stop.sh is not there or that one of them is a symlink to a file that does not exist.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unix script to check whether particular file exists and to find its size

I want to find the size of particular file exists in a particular directory and i wnt to zip it. In the below mentioned code it should check the MQ.log in the particular directory.Please correct my code so that it will check for particular MQ.log but i could not able to check whether the... (9 Replies)
Discussion started by: Balachandar
9 Replies

2. Shell Programming and Scripting

Need to write a script in UNIX to find a file if another file exists

So I have a lot of Java applications on my servers all having their own folder from the applications subdirectory. Now, I need to do the following. Search all the applications subdirectories for message.jar. If the message.jar file exists, I need to search the application directory for... (1 Reply)
Discussion started by: mmdawg
1 Replies

3. Shell Programming and Scripting

find, if exists then append for file with same name

I will have to process multiple files with same name everyday. My requirement is: If on a certain day I see that filename.txt exists then the contents of the filename.txt would be added/append to the former file contents.Each time it sees the file the content would be added.But the header ... (8 Replies)
Discussion started by: RubinPat
8 Replies

4. Shell Programming and Scripting

Verify File exists and execute command

Hi, I am trying to verify that a file exists within an alternate directory. If the file exists, it will execute a copy command...if it does not, it should exit the script. I tried the <test> command and the but keep coming up with syntax errors. I am coding in C Shell and the file... (5 Replies)
Discussion started by: CKT_newbie88
5 Replies

5. Shell Programming and Scripting

Newbie.. Find if a file exists and open, if not create the desired file..

Hey all, I'm brand new to script writing, I'm wanting to make a script that will ask for a file and then retrieve that file if it exists, and if it doesn't exist, create the file with the desired name, and I'm completely stuck.. so far.. #! bin/bash echo "Enter desired file" read "$file" if ... (5 Replies)
Discussion started by: Byrang
5 Replies

6. Shell Programming and Scripting

Script to check for the file existence, if file exists it should echo the no of modified days

Hi, I am looking for a shell script with the following. 1. It should check whether a particular file exists in a location #!/bin/sh if ; then echo "xxx.txt File Exists" else echo "File Not Found" fi 2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies

7. Shell Programming and Scripting

find specific file names and execute a command depending on file's name

Hi, As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
Discussion started by: armando110
3 Replies

8. Windows & DOS: Issues & Discussions

Script that, if file exists in Samba share, moves file to Unix server

I'm looking to do pretty much what the title says. I want a script that runs, it can run on Unix or Windows, doesn't matter, and searches a Samba shares for a .txt file. If the file exists, the script will move (or possibly copy) the file from the Samba share into a directory on our Unix... (3 Replies)
Discussion started by: twcostello
3 Replies

9. UNIX for Dummies Questions & Answers

Statement to find if an entry exists in a file

I need to check if an entry input by the user is in a file. If so, I need to run a command, and if it does not exist then it should output entry does not exist. So I have so far... echo "Enter record:" read record //command || //command Can I use an if statement to do this? (3 Replies)
Discussion started by: itech4814
3 Replies

10. Shell Programming and Scripting

How to find out whether a file exists with the help of regular expression?

Hi all I have a list of file names in array. But this file names are not exact. so i want to search whether a file exists or not using regular expression. code snippet: if ; then echo "File exists" else echo "File does not exits" fi over here "*EQST*" should be treated as a regular... (4 Replies)
Discussion started by: Ganesh_more
4 Replies
SERVICES_MKDB(8)					    BSD System Manager's Manual 					  SERVICES_MKDB(8)

NAME
services_mkdb -- generate the services database SYNOPSIS
services_mkdb [-b | -l] [-q] [-o database] [file] services_mkdb -u [file] DESCRIPTION
The services_mkdb utility creates a db(3) database for the specified file. If no file is specified, then /etc/services is used. The data- base is installed into /var/db/services.db. The file must be in the correct format (see services(5)). The options are as follows: -b Use big-endian byte order for database metadata. -l Use little-endian byte order for database metadata. -o database Put the output databases in the named file. -q Do not warn about duplicate services. -u Print the services file to stdout, omitting duplicate entries and comments. The databases are used by the C library services routines (see The -b and -l flags are mutually exclusive. The default byte ordering is the current host order. getservent(3)). FILES
/var/db/services.db The current services database. /var/db/services.db.tmp A temporary file. /etc/services The current services file. EXIT STATUS
The services_mkdb utility exits 0 on success, and >0 if an error occurs. SEE ALSO
db(3), getservent(3), services(5) BUGS
Because services_mkdb guarantees not to install a partial destination file it must build a temporary file in the same file system and if suc- cessful use rename(2) to install over the destination file. If services_mkdb fails it will leave the previous version of the destination file intact. BSD
April 4, 2010 BSD
All times are GMT -4. The time now is 01:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy