Problem with clear command

Hi All

I'm currently writing a very simple UNIX script to process some work. The very first thing I do on my script is use the "clear" command.

how my file looks...

clear
echo "Return status: $?"

For some strange reason, the return status being returned is 1, not 0 as i expected.

Has anyone ever encountered an anomaly like this before, or could there be some account permissions problem? It's very simple code, so basic that it's got me completely stumped!

Any help would be much appreciated.

hmmm, perhabs the clear command doesn't know your terminal type:

root@jumpy # TERM=asdf
root@jumpy # export TERM
root@jumpy # clear
root@jumpy # echo $?
3
root@jumpy #
root@jumpy # tput clear
tput: unknown terminal "asdf"
root@jumpy #

gP

To get a 1 as the return code, TERM has to a known terminal, but one without a "clear" capability. Try:
export TERM=dumb
tput clear # Or just "clear"...there is a shell wrapper for clear
echo $?