Sponsored Content
Full Discussion: NULL checking
Top Forums Shell Programming and Scripting NULL checking Post 302563447 by radoulov on Tuesday 11th of October 2011 09:18:39 AM
Old 10-11-2011
Or:

Code:
[ -z "$KIT" ] && your code when empty

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Null Value

Hello All, I have a file of the format **** 123 abc ABC 456 bcd BCD 789 def 112 ghi GHI 223 jkl 344 mno MNO **** I am trying to extract the lines that have no values in the third field (in this case, this would be 789 def 223 jkl Can anyone please help??... (1 Reply)
Discussion started by: Khoomfire
1 Replies

2. Shell Programming and Scripting

compare null with non-null

I've got a very peculiar situation. I'm trying to find out if we can compare null fields with non-null. I've output csv files from SQL and Oracle. I need to compare each field from the files, and then find out any differences. The files usualy have over 500 fields, and send the resule to DBA.... (8 Replies)
Discussion started by: nitin
8 Replies

3. Shell Programming and Scripting

Checking for null value

Dear All, I'm glad that I've also joined in this forum. Good work fellas... :b: Keep going...! :) I am having a .csv file where I am reading the values with comma(,) as delimiter. After reading each and every values, I would like to check whether it is empty (say null or blank spaces). How... (4 Replies)
Discussion started by: ganapathi.t
4 Replies

4. Programming

C++ segmentation fault while checking for null pointer

void disptree(node *ptr) { if ((ptr->left) !=NULL) disptree(ptr->left); cout<<"Position:"<<ptr->pos<<" Data:"<<ptr->data<<endl; if ((ptr->right)!=NULL; disptree(ptr->right); } i'm getting a segmentation fault at the red line. i cannot understand what's the problem.... (3 Replies)
Discussion started by: vijaymrt
3 Replies

5. Shell Programming and Scripting

Insert string 'NULL' where there is a null value

I have an input file having 7 fields delimited by , eg : 1,ABC,hg,1,2,34,3 2,hj,YU,2,3,4, 3,JU,kl,4,5,7, 4,JK,KJ,3,56,4,5 The seventh field here in some lines is empty, whereas the other lines there is a value. How do I insert string NULL at this location (7th loc) for these lines where... (8 Replies)
Discussion started by: zilch
8 Replies

6. UNIX for Dummies Questions & Answers

/dev/null 2>&1 Versus /dev/null 2>1

How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&" echo "hello" > /dev/null 2>&1 echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies

7. Programming

Checking an array for NULL in C++

Hello All, I have this question that how to check for an array for NULL? For eg. #include<iostream.h> using namespace std; int main() { char arr; if(arr == NULL) { cout<<"NULL"; } } Thanks a lott in advance!!! (3 Replies)
Discussion started by: mind@work
3 Replies

8. Shell Programming and Scripting

Redirecting standard out to /dev/null goes to file "/dev/null" instead

I apologize if this question has been answered else where or is too elementary. I ran across a KSH script (long unimportant story) that does this: if ; then CAS_SRC_LOG="/var/log/cas_src.log 2>&1" else CAS_SRC_LOG="/dev/null 2>&1" fithen does this: /usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies

9. SCO

Stop boot system at "Checking protected password and checking subsystem databases"

Hi, (i'm sorry for my english) I'm a problem on boot sco unix 5.0.5 open server. this stop at "Checking protected password and checking subsystem databases" (See this image ) I'm try this: 1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094 2) SCO: SCO Unix - Server hangs... (9 Replies)
Discussion started by: buji
9 Replies

10. Shell Programming and Scripting

Checking for null condition in a UNIX variable

i have this code for i in `cat sql_output.txt` do -- some script commands done sql_output.txt has 1 column with employee_ids If the sql_output.txt is null then the do loop should not execute. How can i implement this. for i in `cat sql_output.txt` If i is null or empty then ... (5 Replies)
Discussion started by: rafa_fed2
5 Replies
ATF-CHECK(1)						    BSD General Commands Manual 					      ATF-CHECK(1)

NAME
atf-check -- executes a command and analyzes its results SYNOPSIS
atf-check [-s qual:value] [-o action:arg ...] [-e action:arg ...] [-x] command atf-check -h DESCRIPTION
atf-check executes a given command and analyzes its results, including exit code, stdout and stderr. In the first synopsis form, atf-check will execute the provided command and apply checks specified by arguments. By default it will act as if it was run with -s exit:0 -o empty -e empty. Multiple checks for the same output channel are allowed and, if specified, their results will be combined as a logical and (meaning that the output must match all the provided checks). In the second synopsis form, atf-check will print information about all supported options and their purpose. The following options are available: -h Shows a short summary of all available options and their purpose. -s qual:value Analyzes termination status. Must be one of: exit:<value> checks that the program exited cleanly and that its exit status is equal to value. The exit code can be omit- ted altogether, in which case any clean exit is accepted. ignore ignores the exit check. signal:<value> checks that the program exited due to a signal and that the signal that terminated it is value. The signal can be specified both as a number or as a name, or it can also be omitted altogether, in which case any signal is accepted. Most of these checkers can be prefixed by the 'not-' string, which effectively reverses the check. -o action:arg Analyzes standard output. Must be one of: empty checks that stdout is empty ignore ignores stdout file:<path> compares stdout with given file inline:<value> compares stdout with inline value match:<regexp> looks for a regular expression in stdout save:<path> saves stdout to given file Most of these checkers can be prefixed by the 'not-' string, which effectively reverses the check. -e action:arg Analyzes standard error (syntax identical to above) -x Executes command as a shell command line, executing it with the system shell defined by ATF_SHELL in atf-config(1). You should avoid using this flag if at all possible to prevent shell quoting issues. EXIT STATUS
atf-check exits 0 on success, and other (unspecified) value on failure. EXAMPLES
# Exit code 0, nothing on stdout/stderr atf-check 'true' # Typical usage if failure is expected atf-check -s not-exit:0 'false' # Checking stdout/stderr echo foobar >expout atf-check -o file:expout -e inline:"xx yy " 'echo foobar ; printf "xx yy " >&2' # Checking for a crash atf-check -s signal:sigsegv my_program # Combined checks atf-check -o match:foo -o not-match:bar echo foo baz SEE ALSO
atf-config(1), atf(7) BSD
June 27, 2010 BSD
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy