Problem setting environment...

Hi All

I'm attempting to automate the process of setting the DISPLAY environment variable when logging on (sourcing the .cshrc).

I have a mixture of linux and solaris servers and this comnand:

who -m | awk '{ print $6}' | tr -d '()'

seems to work on all the servers.

I want incorporate this command into the .cshrc (using c-shell).

setenv DISPLAY who -m | awk '{ print $6}' | tr -d '()' 

won't work and I've tried a few combinations of different quotation marks to no avail. I'm fairly confident the issue lies in the syntax but I can't pinpoint where it is!

Any help would be greatly appreciated :slight_smile:

Don't use c-shell but have you tried something like

export DISPLAY=`who -m | awk '{print $6}' | tr -d '()'`

Perfect (I used setenv DISPLAY .... but everything else was fine).

It was those little ` `s - they always catch me out. Thanks!