D dwn.220.v.ua

korn shell test null string

So [ -z "$1" ] is a proper way of testing if $1 is empty, and [ &...

📦 .zip⚖️ 38.3 MB📅 01 May 2026

So [ -z "$1" ] is a proper way of testing if $1 is empty, and [ "$x" = "$y" ] is a proper presumably when "interesting" strings like "-o a=a" are tested. This method works for the traditional bourne shell, as well as ksh, and bash.

⬇ Download Full Version

empty is a string without char but defined, so in this case [ -z "${My...

📦 .zip⚖️ 58.5 MB📅 10 Oct 2025

empty is a string without char but defined, so in this case [ -z "${MyVar}" ]. null is the Use the test -n option, or the ksh / bash [[ ]] equivalent.

⬇ Download Full Version

One way to test for (non-)empty string is to use test and -z (-n) Your shel...

📦 .zip⚖️ 47.4 MB📅 20 Nov 2025

One way to test for (non-)empty string is to use test and -z (-n) Your shell (here ksh on AIX) starts having errors as soon as your subshell (here.

⬇ Download Full Version

hi all, i have a shell (ksh) script where i am reading line by line from a ...

📦 .zip⚖️ 59.7 MB📅 30 May 2026

hi all, i have a shell (ksh) script where i am reading line by line from a grep to check if the grep command actually returned something or was null. i can do -z, or even just the unquoted string alone within test brackets (see  How to check if two variable are empty strings at once.

⬇ Download Full Version

The simplest expression is a string which is true if the string is non-empt...

📦 .zip⚖️ 16.8 MB📅 30 Oct 2025

The simplest expression is a string which is true if the string is non-empty is not set, test, [, and [[ behave as in the standard Korn Shell and quietly ignore any.

⬇ Download Full Version

Matching Patterns; Conditional Statements; Test Objects (Files, Directories...

📦 .zip⚖️ 86.8 MB📅 26 Jan 2026

Matching Patterns; Conditional Statements; Test Objects (Files, Directories, etc.) _str2_ ]] strings not equal [[ _str1_ _str2_ ]] _pattern_ ]] str1!= pattern [[ -z _str_ ]] str is null [[ -n _str_ ]] str is not null [ x=y.

⬇ Download Full Version

Return true if a bash variable is unset or set to the empty string: if [ -z...

📦 .zip⚖️ 43.8 MB📅 09 Mar 2026

Return true if a bash variable is unset or set to the empty string: if [ -z .. Bash Shell: Find Out If a Variable Is Set or Not; bash(1); test(1); help [; help [[ Double brackets were introduced by David Korn in ksh in the early 80s.

⬇ Download Full Version

Check if parameter is NULL (shell scripting) Programming & Packaging. I...

📦 .zip⚖️ 117.2 MB📅 25 May 2026

Check if parameter is NULL (shell scripting) Programming & Packaging. I'd like it to work under ksh, but if it can only be done under bash then fine!:) the quoted test strings then echo "Strings \"$1\" and \"$2\" are not null.

⬇ Download Full Version

Test Operators These are the operators that are used with the [[. Selection...

📦 .zip⚖️ 27.7 MB📅 11 Feb 2026

Test Operators These are the operators that are used with the [[. Selection from Learning the Korn Shell, 2nd Edition [Book] -n string, string is non-null.

⬇ Download Full Version

Ensure that variables exist (i.e., are defined and have non-null values) Th...

📦 .zip⚖️ 80.6 MB📅 17 Aug 2025

Ensure that variables exist (i.e., are defined and have non-null values) The first group of string-handling operators tests for the existence of variables . Advanced Unix users will find the Korn shell's regular expression capabilities useful for.

⬇ Download Full Version

This will return true if a variable is unset or set to the empty string (&q...

📦 .zip⚖️ 53.8 MB📅 10 Dec 2025

This will return true if a variable is unset or set to the empty string (""). You can simplify the test for a variable that does contain a value to: if [[ $variable ]]. This syntax is compatible with ksh (at least ksh93, anyway). It does not.

⬇ Download Full Version

To make a ksh script (which is a ksh program) crate a new file with a start...

📦 .zip⚖️ 55.9 MB📅 10 Feb 2026

To make a ksh script (which is a ksh program) crate a new file with a starting line like: A script has four types of lines: The shell defining line at the top, empty lines, have a name which is identical to a unix command: So the script must NOT be called "test"! There is no difference between strings and numbers: price=

⬇ Download Full Version

A tutorial on Unix shell scripting with Bourne and Korn shells. shells for ...

📦 .zip⚖️ 111.3 MB📅 13 Nov 2025

A tutorial on Unix shell scripting with Bourne and Korn shells. shells for which [ is an external program, the only way to test for a null string is.

⬇ Download Full Version

test "$X" = abc && print "X is set to abc" or [...

📦 .zip⚖️ 50.1 MB📅 01 Sep 2025

test "$X" = abc && print "X is set to abc" or [ "$X" = abc ] && print "X is set to is set to null" Checking Patterns The Korn shell also lets you compare strings to.

⬇ Download Full Version

Try using the -z test: if [ -z "$1" ] && [ -z "$2&qu...

📦 .zip⚖️ 83.9 MB📅 07 Jan 2026

Try using the -z test: if [ -z "$1" ] && [ -z "$2" ]. From man bash: z string True if the length of string is zero.

⬇ Download Full Version