whoami export

how can I use whoami on a script for ordinary user? it always says command not found. pls help

#!/bin/ksh
W='whoami'
DATE=`date "+%Y-%m-%d %H:%M:%S"`

echo " $DATE- by $W"

result

2011-03-29 09:46:16 -  by

you wil noticed the by is blank...pls help..but in root, it works

Hey man, you got the code wrong. Change the single quote in W to `.

W=`whoami`
DATE=`date "+%Y-%m-%d %H:%M:%S"`

echo " $DATE- by $W"

Output:
2011-03-29 10:18:36- by ******