How to query number of attached monitors in csh?

Hi there,

I am currently writing a csh script in which I want to be able to interrogate the hardware by some means in order to determine whether or not dual monitors are connected. This can't unfortunately be done by looking at xorg.conf because although some of the machines in question have extended desktops over both monitors (in which case the xorg.conf does differ), some do not and just have twinview mirrored desktop enabled (in which case xorg.conf is identical to a single monitor machine).

Basically one thing needs to happen if a CRT is attached as well as an LCD (the dual monitor setup always includes a CRT) and another thing needs to happen if just an LCD is attached, so the solution could also be based around finding if a CRT is attached or not rather than just if 2 monitors are present.

Can anyone suggest any solution to this problem?

Thanks!

Jon

---------- Post updated at 09:21 AM ---------- Previous update was at 04:07 AM ----------

Bah, one of those that never gets replied I fear.....

Top Ten Reasons not to use the C shell
Csh problems
Csh Programming Considered Harmful

Thank you for that, but I have already read more than my fair share of replies remarkably similar to yours whenever csh is mentioned as the shell in use.

Just perhaps I am trying to integrate this script into an already existent infrastructure and csh is my only choice...

I appreciate that you want to make people aware, but it really doesn't help to answer the question I have asked does it?