#! /bin/sh # # Filename: vartest # # Programmer: Br. David Carlson # # Date: January 22, 1995 # # Illustrates use of test -z to see if a string variable is empty. # myvar=hello if test -z "$myvar" then echo empty else echo nonempty fi # Now try again with the empty string: myvar= if test -z "$myvar" then echo empty else echo nonempty fi