How to grep string from nohup.out file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to grep string from nohup.out file
# 1  
Old 09-23-2011
How to grep string from nohup.out file

Hi,
I have one shell script, which run another one script inside in nohup mode. I want to search one string from the nohyup.out file in the same mail shell script itself .Can anyone help me??
Please find the code below:
Code:
total_ear=`cd ear ; ls *.ear | wc -l | tr -d ' '`
for ear in `cd ear ; ls *.ear`
do
  date
  echo ^^^^ $total_ear deployment remaining ^^^^
  service=$(echo $ear | sed "s/.ear//")
  echo --- Deploying service $service ---
  if  nohup ./deploy.sh $service &
  then
    ##### Here i need to grep "Successful" string from the nohup.out file#####

Please help me on this.

Thanks,
Chelladurai.

Last edited by Scott; 09-23-2011 at 09:38 AM.. Reason: Code tags, please; edit: double post, closed.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace string of a file with a string of another file for matches using grep,sed,awk

I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: --> cat comp.pkglist Package list: nss-util-devel-3.28.4-1.el6_9.x86_64 Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies

2. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

3. Shell Programming and Scripting

Grep string in files and list file names that contain the string

Hi, I have a list of zipped files. I want to grep for a string in all files and get a list of file names that contain the string. But without unzipping them before that, more like using something like gzcat. My OS is: SunOS test 5.10 Generic_142900-13 sun4u sparc SUNW,SPARC-Enterprise (8 Replies)
Discussion started by: apenkov
8 Replies

4. Shell Programming and Scripting

grep exact string from files and write to filename when string present in file

I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies

5. Shell Programming and Scripting

grep a string in a file

Hi , i'm trying to create a code for the belwo scenario. i have a data in a file file.txt like below. ram dept comp shyam field comp Now i need write a code to find the string which is always 2 lines before the string "comp" Can you please help me in this. Thanks in advance (15 Replies)
Discussion started by: p.bhaskar
15 Replies

6. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

7. Shell Programming and Scripting

grep from the nohup.out file

Hi, I have one shell script, which run another one script inside in nohup mode. I want to search one string from the nohup.out file in the same shell script itself .Can anyone help me?? Please find the code below: total_ear=`cd ear ; ls *.ear | wc -l | tr -d ' '` for ear in `cd ear ; ls... (1 Reply)
Discussion started by: ckchelladurai
1 Replies

8. Shell Programming and Scripting

grep string from a file

hi everyone, 1.txt 12 34 56 2.txt 456----aa abc;b;b;b 34;a;a;a;a output is 456----aa 34;a;a;a;a (11 Replies)
Discussion started by: jimmy_y
11 Replies

9. Shell Programming and Scripting

If else - grep a string in a file

Hi all, I would want to recieve notification only if there are sessions block in our databases. This is my script, but it's not working. No matter what is the contents in the $OUTFILE, I get emails. /usr/bin/cat $OUTFILE | read selected if then echo "No session is blocked" else ... (7 Replies)
Discussion started by: *Jess*
7 Replies

10. Shell Programming and Scripting

How to grep a string in todays file

Hello guys - I am new to Unix. I am trying to understand how to grep a perticular string in todays file? I am trying this syntax but not getting what I am looking for: % grep `date '+%d/%b/%Y'` For instance there are 2 files generated today with same data. I am trying to find them and... (21 Replies)
Discussion started by: DallasT
21 Replies
Login or Register to Ask a Question
NOHUP(1)						    BSD General Commands Manual 						  NOHUP(1)

NAME
nohup -- invoke a utility immune to hangups SYNOPSIS
nohup [--] utility [arguments] DESCRIPTION
The nohup utility invokes utility with its arguments and at this time sets the signal SIGHUP to be ignored. If the standard output is a ter- minal, the standard output is appended to the file nohup.out in the current directory. If standard error is a terminal, it is directed to the same place as the standard output. Some shells may provide a builtin nohup command which is similar or identical to this utility. Consult the builtin(1) manual page. ENVIRONMENT
The following variables are utilized by nohup: HOME If the output file nohup.out cannot be created in the current directory, the nohup utility uses the directory named by HOME to create the file. PATH Used to locate the requested utility if the name contains no '/' characters. EXIT STATUS
The nohup utility exits with one of the following values: 126 The utility was found, but could not be invoked. 127 The utility could not be found or an error occurred in nohup. Otherwise, the exit status of nohup will be that of utility. SEE ALSO
builtin(1), csh(1), signal(3) STANDARDS
The nohup utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. BUGS
Two or more instances of nohup can append to the same file, which makes for a confusing output. BSD
July 19, 2001 BSD