On 30.03.2011 14:09, Mart Frauenlob wrote:
[...]
so the test command sees
'word2' while it expects another operator.
sorry, i meant to write 'word1'
On Wed, Mar 30, 2011 at 02:43:58PM +0430, ali hagigat wrote:
> --
> var1="word1 word2"
> echo $var1
> if (test -z "\"$var1\"") then
> echo "first"
> else
> echo second
> fi
Problems in this script:
* Unquoted $var1 on line 2. This means that instead of pass
On 30.03.2011 12:13, ali hagigat wrote:
The following scripts were run for /bin/bash, version 4.0.33, and then
comes their outputs. In the second example seems to have a warning:
"binary operator expected". Why the error is generated? and why there
is no error for the first example?
-
On Wednesday 30 Mar 2011 11:13:58 ali hagigat wrote:
> The following scripts were run for /bin/bash, version 4.0.33, and then
> comes their outputs. In the second example seems to have a warning:
> "binary operator expected". Why the error is generated? and why there
> is no error for the first ex
The following scripts were run for /bin/bash, version 4.0.33, and then
comes their outputs. In the second example seems to have a warning:
"binary operator expected". Why the error is generated? and why there
is no error for the first example?
--
var1="word1 word