Regid Ichira:
>
> Within a shell, what is the difference between [ -n undefinedString ] and [
> -n "$undefinedString" ] ?
The interesting difference is between $undefinedString and
"$undefinedString". The former resolves to literally nothing, not even
an empty string. When you use qoutes, you g
On Sat, Sep 17, 2011 at 09:11:16AM -0700, Regid Ichira wrote:
> Within a shell, what is the difference between [ -n undefinedString ] and [
> -n "$undefinedString" ] ?
> With bash I get:
>
> $ unset undefinedString
> $ [ -n undefinedString ] && printf "$undefinedString" | od -c
>
Regid Ichira wrote:
> Within a shell, what is the difference between [ -n undefinedString ] and [
> -n "$undefinedString" ] ?
>With bash I get:
>
>$ unset undefinedString
>$ [ -n undefinedString ] && printf "$undefinedString" | od -c
>000
You are just testing for the length of
Within a shell, what is the difference between [ -n undefinedString ] and [
-n "$undefinedString" ] ?
With bash I get:
$ unset undefinedString
$ [ -n undefinedString ] && printf "$undefinedString" | od -c
000
$ [ -n "$undefinedString" ] && printf "$undefinedString" | od
4 matches
Mail list logo