Sponsored Content
Top Forums Shell Programming and Scripting How to add a status once a step is complete on the header part of a menu? Post 302898921 by chacko193 on Friday 25th of April 2014 03:15:14 AM
Old 04-25-2014
Code:
     if [ $RET -gt 0 ]      then         status = "COMPLETE"      else         status = "FAILED"      fi

Remove the spaces while you are assigning.
The command will return 0 if its has completed successfully and >0 if it failed.So you need to change your test.

Use separate variables to store the status for different options. This will show the same status for all the options.

And what should be the value when its being run for the first time?
Better initialize status with some value.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

works step by step on command line but not in script

Hi all, The following script is fine when I work via command line m=1 c=0 while do echo $m gnokii --getsms IN $m > out.txt; m=`expr $m + 1`; cat out.txt >> message_log; ############ read first crap< <(sed -n '/Text:/{n;p;}' out.txt); read message< <(sed -n '/Text:/{n;p;}'... (2 Replies)
Discussion started by: whamchaxed
2 Replies

2. Shell Programming and Scripting

comparing part of header with part of detailed records.

Hi there, I am lil confused with the following issue. I have a File, which has the following header: IMSHRATE_043008_101016 a sample detailed record is :9820101 A982005000CAVG030108000000000000010169000MAR 2008 9820102 MAR 2008 D030108 ... (1 Reply)
Discussion started by: cmaroju
1 Replies

3. UNIX for Dummies Questions & Answers

BASH complete-filename & menu-complete together

Hi, Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab? Right now this is what I have in my .bashrc: bind "set show-all-if-ambiguous on" bind \\C-o:menu-complete This allows... (0 Replies)
Discussion started by: Mithu
0 Replies

4. Linux

May you explain step by step where and how I will add pseudo code

Thank all of you. May you explain step by step where and how I will add pseudo code Note : I have Linux 2.6.24-26-server on x86_64 dears kindly help me (3 Replies)
Discussion started by: nonowa
3 Replies

5. Shell Programming and Scripting

Add column header and row header

Hi, I have an input like this 1 2 3 4 2 3 4 5 4 5 6 7 I would like to count the no. of columns and print a header with a prefix "Col". I would also like to count the no. of rows and print as first column with each line number with a prefix "Row" So, my output would be ... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

6. Red Hat

Bash: menu-complete and reverse

Hi, In the archives I found this: And this works fine. $if mode=vi "\C-0-": digit-argument TAB: menu-complete "\e But what I want is to reverse this. So I want that tab does reverse menu completion and shift tab does normal menu completion. Can anyone help me with this? Thanks (0 Replies)
Discussion started by: ozkanb
0 Replies

7. UNIX for Beginners Questions & Answers

Automation script for email alert when a job get complete with status successful.

Guyz, Please let me know about script which is to be sending an automatic email to particular mail id's when a monotoring job get complete with status successful. (1 Reply)
Discussion started by: Rehan Ahmad
1 Replies

8. What is on Your Mind?

Slowly Removing Bold Font Style - Step-by-Step

FYI, I'm slowly removing a lot of the bold font-styles from titles of discussions, forum titles, etc I'm not removing bold for the entire site because we do need bold from time to time, especially in posts and sometimes in other places. However, the original forum style had way too much... (3 Replies)
Discussion started by: Neo
3 Replies
pthread_exc_get_status_np(3)				     Library Functions Manual				      pthread_exc_get_status_np(3)

NAME
pthread_exc_get_status_np - (Macro) Obtains a system-defined error status from a DECthreads status exception object. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread_exception.h> int pthread_exc_get_status_np( EXCEPTION *exception, unsigned long *code); STANDARDS
None PARAMETERS
DECthreads status exception object whose status code is obtained. Receives the system-specific status code associated with the specified DECthreads status exception object. DESCRIPTION
This routine obtains and returns the system-specific status value from the DECthreads status exception object specified in the exception argument. This value must have already been associated with the exception object using the pthread_exc_set_status_np(3) routine. In a program that uses DECthreads status exceptions, use this routine within a CATCH, CATCH_ALL, or FINALLY code block to obtain the status code value associated with a caught exception. Note that any exception objects set to the same status value are considered equivalent by DECthreads. RETURN VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. If the routine's exception object argu- ment is a DECthreads status exception, it sets the code argument and return zero (0). Possible return values are as follows: Successful completion. The exception argument is not a valid DECthreads status exception object. ERRORS
None RELATED INFORMATION
Functions: pthread_exc_set_status_np(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_exc_get_status_np(3)
All times are GMT -4. The time now is 04:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy