![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| plz clear my doubts | soumya_v7 | UNIX for Dummies Questions & Answers | 3 | 03-13-2008 01:06 PM |
| What command do you use to clear the print que? | nov_user | UNIX for Dummies Questions & Answers | 1 | 10-01-2007 10:09 AM |
| Clear confusion | vibhor_agarwali | UNIX for Dummies Questions & Answers | 4 | 07-14-2005 05:21 AM |
| clear memory | fenomen | UNIX for Dummies Questions & Answers | 2 | 06-24-2003 06:33 AM |
| How to clear screen | giannicello | High Level Programming | 2 | 05-14-2002 01:32 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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 $? |
||||
| Google The UNIX and Linux Forums |