[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ReturnsZero(): command does not return zero. Is class created with v
From: |
Hans Deragon |
Subject: |
Re: ReturnsZero(): command does not return zero. Is class created with value of false? |
Date: |
Wed, 01 Oct 2003 09:38:55 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030905 |
Mark.Burgess@iu.hio.no wrote:
I'm sorry -- I didn't read this properly first time
around. the problem is a misunderstanding of the ReturnZero()
function. It is the value of the shell returncode that is tested
not the value of the text string printed by the command.
You will need to use StrCmp("0",$returnvar) if you want to test that.
Since fgrep will always succeed if /etc/passwd exists, it will always
return zero in the sense of ReturnZero().
...and again, you still have not read properly (or understand fgrep return
codes). :) What I do is check for a user in the /etc/passwd:
[qhander@snah1 qhander] /bin/fgrep -c lmclxadm /etc/passwd
0
[qhander@snah1 qhander] echo $?
1
So the return code is 1. accountexist is therefore not defined. !accountexist
should trigger, but it does not. Bug.
I believe it is explained in the manual that classes are attributes
that are either defined or not. It is certainly implicit in all
of the docs, but whether or not it is clear is of course a matter
of opinion! :)
Mark
Mmmm... I would have brought a few changes to the documentation to make it
clearer. But, now that I know...
Thanks,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc. Open source:
http://www.deragon.biz http://swtmvcwrapper.sourceforge.net
mailto://hans@deragon.biz http://autopoweroff.sourceforge.net