man test
:shock: :shock: Son of a....
]]>Is there a list available anywhere? I've tried man if, but that's no good...
It uses the "test" command internally - try "man test"
]]>vt=`fgconsole`
if [ $vt -ne 7 ]; then
vbetool
fi
or as a one-liner:
[ `fgconsole` -ne 7 ] && vbetool
The thing is, I've finally managed to work around the garbled-screen-in-console-after-a-resume-from-sleep problem that I've had, albeit in a rather crippled way. I use vbetool restore to acomplish this, which works fine. I've noticed, though, that after a resume, I have to restore the vbestate every time I switch from X to console. That is, every time I switch, the screen is garbled and I have to restore the VBE. What I did was to trigger a bash script that restores the VBE whenever I press my power button.
Now, to the problem:
when I do this in X, X goes nuts and I have to restart it. For this reason I want a safety-net in my script that checks if the current VT is <7, in which case it restores the VBE; otherwise, I want it to do nothing at all. How do I do this? I know that the command 'fgconsole' gives the current VT, but how do I incorporate this in the if command?
Thanks in advance
]]>