![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FTP script and problem | lawadm1 | Shell Programming and Scripting | 1 | 06-18-2007 06:44 PM |
| Ksh problem in script | PradeepRed | Shell Programming and Scripting | 3 | 08-24-2006 03:21 AM |
| Some problem with script. | 12yearold | Shell Programming and Scripting | 14 | 08-03-2006 02:29 AM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 09:12 AM |
| problem with a script | Lestat | Shell Programming and Scripting | 4 | 06-13-2005 01:30 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
ssh script problem problem
Hi
Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 [DEBUG] [ageListenerThreadPool : 0] ConnectionFactory - Setting session state for connection. 2008-07-23 12:59:47,203 [DEBUG] [ageListenerThreadPool : 2] ConnectionFactory - Setting session state for connection. host001-03 2008-07-24 11:51:56,883 [DEBUG] [AQUEDUCT-WebContainer : 1] ConnectionFactory - Setting session state for connection. 2008-07-24 11:47:18,448 [DEBUG] [ageListenerThreadPool : 2] ConnectionFactory - Setting session state for connection. Shell script code ================= while read line; do temp_output=`echo $line | grep host001` if [ "$temp_output" != "" ]; then SERVER="$line" else thread_name=`echo $line | awk '{print $4,$5,$6}' | perl -wn -e 'print "$1\n" if m{[\[](.*?)[\]]};'` date_string=`echo $line | awk '{print $1,$2}'` ssh $SERVER cat "\`find / -mtime -1 -name 'app.log*' | sort -r\`" | fgrep -H -B25 '$date_string' | egrep -e 'The Message is' | egrep -e '$thread_name'; fi done < $input_file Expected Output: =============== It should search for the strings on each host and display the message ( Please note that i have modified code to paste in the forum) and instead it's displaying output for first message(2008-07-23 13:02:04,651 [DEBUG]) and exiting the script and no error messages. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|