Sponsored Content
Full Discussion: Bash output analysis script
Top Forums Shell Programming and Scripting Bash output analysis script Post 302817791 by Corona688 on Thursday 6th of June 2013 12:55:03 PM
Old 06-06-2013
Does this process run quickly and quit, or does it slowly print a number of lines?

If it's the latter, which I suspect, I'd do this:

Code:
process | while read LINE
do
        case "$LINE" in
        *Error*)
                echo "Something happened"
                ;;
        esac
done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why generate "ash and bash" different output for same bash script?

Hi, For my bash script, terminal with bash is generate an OK output and program works right. already, terminal with ash have "line 48: syntax error: Bad substitution" output and program don't work. :confused: (0 Replies)
Discussion started by: s. murat
0 Replies

2. Shell Programming and Scripting

Bash script undesired output

hi guys, When for example, I want to get the size of a partition, I have done the following: # result=`fdisk -l | grep /dev/sda1` # echo $result /dev/sda1 1 15000 120487468+ 83 Linux and then I parse this output to get the size. That's just fine. The problem here is that, when I have a... (4 Replies)
Discussion started by: alirezan
4 Replies

3. UNIX for Dummies Questions & Answers

How do i tell my bash shell script to test the output of a command against something

How do i tell my bash shell script to test the output of the command i'm using?? I want this script to look for lines not equal to 1 then let me know.. $ cat blah ; echo ---- ; cat blah.sh 1 fe 1 fi 1 fo 0 fum 1 blahda 1 blah 0 blahh 1 bla 1 bl 1 blahhh ---- #!/bin/bash while... (1 Reply)
Discussion started by: phpfreak
1 Replies

4. Shell Programming and Scripting

Reading output from terminal back into bash script

How can I get a bash script to wait and read and count $i messages that a running program (drbl clonezilla) sends to the console (terminal) and only then move on to the next line in the script when the count is matched (the next line is the last line of the script and is a reboot)? The script... (0 Replies)
Discussion started by: dp123
0 Replies

5. Shell Programming and Scripting

Piping output from a command into bash script

Hi all. I am using procmail to deliver an email to a script I am developing. Procmail delivers the email to the script on standard input. I imagine this is the same as piping input from a command into the script. Hence I've been testing my script by running echo 'test' | sms-autosend-backup.sh ... (2 Replies)
Discussion started by: akindo
2 Replies

6. Shell Programming and Scripting

Bash script show Kill system output

Hi we are calling kill -9 $pid command from bash script it gives below output, but we need to hide the output. i tried /dev/null but ni luck. is there any alternate way to schive this. ../kill_scr.sh: line 42: 1891 Killed /tmp/anr_rest_mul_wc.sh Soalris 10. ... (2 Replies)
Discussion started by: sachinbutala
2 Replies

7. Shell Programming and Scripting

[Solved] Output in bash script not captured in variable

I'm tring to write down a simple script that would execute a command and wait until it returns a specific result. This is what i did: bjobs_out=`bjobs` while ]; do bjobs_out=`bjobs` sleep 6 done It seems to work until the command 'jobs' return the list of jobs in execution, but... (4 Replies)
Discussion started by: lifedj
4 Replies

8. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

9. Shell Programming and Scripting

Bash process output analysis

Looking to create a script to listen to each output from a task while it is running and launch a function if a specific error message is found at any point and if not to continue uninterrupted. #!/bin/bash read checker <<< $(reaver -i mon0 -b 'target bssid' -vv) if ; then function elif... (1 Reply)
Discussion started by: 3therk1ll
1 Replies
Error Construction(3)						   globus common					     Error Construction(3)

NAME
Error Construction - Macros #define GLOBUS_ERROR_TYPE_GLOBUS Construct Error globus_object_t * globus_error_construct_error (globus_module_descriptor_t *base_source, globus_object_t *base_cause, int type, const char *source_file, const char *source_func, int source_line, const char *short_desc_format,...) globus_object_t * globus_error_v_construct_error (globus_module_descriptor_t *base_source, globus_object_t *base_cause, const int type, const char *source_file, const char *source_func, int source_line, const char *short_desc_format, va_list ap) Initialize Error globus_object_t * globus_error_initialize_error (globus_object_t *error, globus_module_descriptor_t *base_source, globus_object_t *base_cause, int type, const char *source_file, const char *source_func, int source_line, const char *short_desc_format, va_list ap) Detailed Description Create and initialize a Globus Generic Error object. This section defines operations to create and initialize Globus Generic Error objects. Macro Definition Documentation #define GLOBUS_ERROR_TYPE_GLOBUS Error type definition. Function Documentation globus_object_t* globus_error_construct_error (globus_module_descriptor_t *base_source, globus_object_t *base_cause, inttype, const char *source_file, const char *source_func, intsource_line, const char *short_desc_format, ...) Allocate and initialize an error of type GLOBUS_ERROR_TYPE_GLOBUS. Parameters: base_source Pointer to the originating module. base_cause The error object causing the error. If this is the original error this paramater may be NULL. type The error type. We may reserve part of this namespace for common errors. Errors not in this space are assumed to be local to the originating module. source_file Name of file. Use FILE source_func Name of function. Use _globus_func_name and declare your func with GlobusFuncName(<name>) source_line Line number. Use LINE short_desc_format Short format string giving a succinct description of the error. To be passed on to the user. ... Arguments for the format string. Returns: The resulting error object. It is the user's responsibility to eventually free this object using globus_object_free(). A globus_result_t may be obtained by calling globus_error_put() on this object. globus_object_t* globus_error_v_construct_error (globus_module_descriptor_t *base_source, globus_object_t *base_cause, const inttype, const char *source_file, const char *source_func, intsource_line, const char *short_desc_format, va_listap) Allocate and initialize an error of type GLOBUS_ERROR_TYPE_GLOBUS. Parameters: base_source Pointer to the originating module. base_cause The error object causing the error. If this is the original error this paramater may be NULL. type The error type. We may reserve part of this namespace for common errors. Errors not in this space are assumed to be local to the originating module. source_file Name of file. Use FILE source_func Name of function. Use _globus_func_name and declare your func with GlobusFuncName(<name>) source_line Line number. Use LINE short_desc_format Short format string giving a succinct description of the error. To be passed on to the user. ap Arguments for the format string. Returns: The resulting error object. It is the user's responsibility to eventually free this object using globus_object_free(). A globus_result_t may be obtained by calling globus_error_put() on this object. globus_object_t* globus_error_initialize_error (globus_object_t *error, globus_module_descriptor_t *base_source, globus_object_t *base_cause, inttype, const char *source_file, const char *source_func, intsource_line, const char *short_desc_format, va_listap) Initialize a previously allocated error of type GLOBUS_ERROR_TYPE_GLOBUS. Parameters: error The previously allocated error object. base_source Pointer to the originating module. base_cause The error object causing the error. If this is the original error this paramater may be NULL. type The error type. We may reserve part of this namespace for common errors. Errors not in this space are assumed to be local to the originating module. source_file Name of file. Use FILE source_func Name of function. Use _globus_func_name and declare your func with GlobusFuncName(<name>) source_line Line number. Use LINE short_desc_format Short format string giving a succinct description of the error. To be passed on to the user. ap Arguments for the format string. Returns: The resulting error object. You may have to call globus_error_put() on this object before passing it on. Author Generated automatically by Doxygen for globus common from the source code. Version 14.7 Tue Nov 27 2012 Error Construction(3)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy