Sponsored Content
Full Discussion: Parsing null or empty output
Top Forums UNIX for Beginners Questions & Answers Parsing null or empty output Post 303009120 by MadeInGermany on Saturday 9th of December 2017 03:17:49 AM
Old 12-09-2017
With a shell glob you need two conditions
Code:
if [[ -z $lastseen ]] || [[ $lastseen == *[_a-zA-Z]* ]]
then
  echo "empty or has an alpha character"
fi

Code:
if [[ -z $lastseen ]] || [[ $lastseen == *[!0-9]* ]]
then
  echo "empty or has a non-digit character"
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check for null or empty string

Hi, I need to check for value not equal (<>) to 21 and not equal empty or null values. Please modify this script if then echo "$VALUE,$BSC_NAME,$BSC_ID" > $OUT_FILE/power_up.out end if TQ (5 Replies)
Discussion started by: doer
5 Replies

2. Shell Programming and Scripting

Removing Null data in output

Hello all, I have a script that has an infile with system package information. For the most part the script is looking well. The only thing i need help is in testing for null entries and removing null data. #!/usr/bin/ksh for i in `cat /mwncps/bin/eco_pack` do NAME=`pkginfo -l |... (2 Replies)
Discussion started by: liketheshell
2 Replies

3. Shell Programming and Scripting

Table null is empty

hi I m executing a shell script in which records are to be fetched from a table. If the sql that is running empty result set it is displaying "table null is empty !". I dont want this msg on the standard output. COuld you please help me in this regard (3 Replies)
Discussion started by: priyanka3006
3 Replies

4. UNIX for Dummies Questions & Answers

cp output /dev/null results in not a directory

Hello, I am working on a script to measure the read performance of a busybox environment. The logical choice is to use a command line like: (time cp * /dev/null) 2> /tmp/howlong.txt Ah, the rub is cp or /dev/null will only accept a single file at a time. The result in the txt file is and... (1 Reply)
Discussion started by: stevesmo
1 Replies

5. Shell Programming and Scripting

PHP: how can I delete empty/NULL elements from a multi-dimensional array.

Hi all I have a file that i'm running and exec(cat ./dat) against..and putting its contents into any array, then doing an exploding the array into a multi-dimension array... The 15 multi-dimensional arrays have elements that are null/empty, I would like to remove/unset these elements and then... (2 Replies)
Discussion started by: zeekblack
2 Replies

6. Shell Programming and Scripting

Redirect system output to null in perl

Hi Guys, Please help me.. it is urgent. I am writing a perl script to capture command output and redirect it to a logfile.At the same i want to check the return code of the command and log it if the command is not succesful in my logfile.. Here is my code, it is working but system command inside... (2 Replies)
Discussion started by: sriramperumalla
2 Replies

7. Shell Programming and Scripting

redirect the audio output to /dev/null

I'm using an text-to-speech synthesis in a script, and I need to redirect it's output to /dev/null how can I do that ? And how to redirect the stream to his normal output then (sound card ) ? thankx (2 Replies)
Discussion started by: firelink
2 Replies

8. Shell Programming and Scripting

How to handle NULL value output from ISQL command?

I am using ISQL command in ksh script. Suppose if i get NULL value from the query which i run,how can i handle it? I am getting a NULL result set and the following error is coming. ############### output of isql command for getting the sum of JEs ################ ----------- NULL... (4 Replies)
Discussion started by: Sharma331
4 Replies

9. Shell Programming and Scripting

How to control a null output in EMC storage?

I dont want to print the output in a EMC VMAX storage if it says "The specified device was not found", however it is not letting me do it. I am trying to run this command: symaccess -sid xxxx list -type storage -devs 1234 output: The specified device was not found I just want the script... (1 Reply)
Discussion started by: prodigy06
1 Replies

10. Shell Programming and Scripting

Identify empty file with null record

Hi Team, I have a file abc.dat which is a empty file. But it has null record in first line. I need to identify this unique file and handle it separately. scenario 1: abc/dw> wc abc.dat 1 0 1 abc.dat abc/dw> cat abc.dat abc/dw> scenario 2: abc/dw> wc pqr.dat 0 0 0 pqr.dat... (3 Replies)
Discussion started by: kmanivan82
3 Replies
ustrzncpy(3alleg4)						  Allegro manual						ustrzncpy(3alleg4)

NAME
ustrzncpy - Copies a string into another one, specifying size. Allegro game programming library. SYNOPSIS
#include <allegro.h> char *ustrzncpy(char *dest, int size, const char *src, int n); DESCRIPTION
This function is like ustrzcpy() except that no more than `n' characters from `src' are copied into `dest' whose length in bytes is speci- fied by `size' and which is guaranteed to be null-terminated even if `src' is bigger than `size'. If `src' is shorter than `n' characters, null characters are appended to `dest' as padding until `n' characters have been written. In any case, `dest' is guaranteed to be null-ter- minated. Note that, even for empty strings, your destination string must have at least enough bytes to store the terminating null character of the string, and your parameter `size' must reflect this. Otherwise, the debug version of Allegro will abort at an assertion, and the release version of Allegro will overrun the destination buffer. RETURN VALUE
The return value is the value of `dest'. SEE ALSO
uconvert(3alleg4), ustrzcpy(3alleg4), ustrncpy(3alleg4), exkeys(3alleg4) Allegro version 4.4.2 ustrzncpy(3alleg4)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy