unprophete
Technical User
Hello,
what does the eval do?
in a ksh script I have found:
PROCLST='ps -ef|grep cal7w|grep -v grep'
and later in the same script...
if [ `eval $PROCLST | wc -l` -ne 0 ]
then
echo "`eval $PROCLST`"
....
what does eval do in the above test and later in "echo" command? is it correct?
what if the eval would be removed in both cases (in the 'test' replaced by echo)? what would be the difference then in functionality?
could someone please explain it (maybe on some examples) like to a newbie?
Best regards,
Matthias.
what does the eval do?
in a ksh script I have found:
PROCLST='ps -ef|grep cal7w|grep -v grep'
and later in the same script...
if [ `eval $PROCLST | wc -l` -ne 0 ]
then
echo "`eval $PROCLST`"
....
what does eval do in the above test and later in "echo" command? is it correct?
what if the eval would be removed in both cases (in the 'test' replaced by echo)? what would be the difference then in functionality?
could someone please explain it (maybe on some examples) like to a newbie?
Best regards,
Matthias.