awesome ultimate expert hen (mdyesowitch) wrote,
awesome ultimate expert hen

  • Mood:

Multiple guess

I am a moron smart!
ETA: Good grief. One extra character and the whole thing goes mad. 8-)
I just fixed my .login script. Hoppie helped me write it and it worked perfectly until today. But I found (and after much thrashing) fixed the problem! Go me!

I log in to my UNIX machine from my windows machine, but I Xwindow back to my Windows machine(s).
Hoppie helped me fixed the script so that instead of hard-defaulting to my office machine, I could default to whichever machine I was logged in from.
This is the code he gave me:

set tty=`tty | sed 's%/dev/%%'`
set host=`finger | grep "$tty" | awk '{print $NF}' | awk -F. '{print $1}'`
setenv DISPLAY {$host}:0.0

Well, Larry logged in yesterday, which resulted in the $host being something like marci-machine larry-machine, which in turn results in too many options specified for the setenv DISPLAY.

I changed the set host line to:
set host=`finger | grep marci | grep "$tty" | awk '{print $NF}' | awk -F. '{print $1}'`

which will work as long as I'm never logged in from both home and the office. At some point I'll have to come up with something better. (And I'm open to suggestions)
Tags: work
  • Post a new comment


    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.