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

  • 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
Subscribe

  • The nature of the Soul

    While I was driving, I got to pondering, again, what I would have said to Tom Riddle, if he had approached me as he approached Horace Slughorn.…

  • On Snape, the Potions Master

    (copied from my Facebook) [I have been] thinking about how fortunate Hogwarts was to have Snape as potions master. I remember thinking when I was…

  • Rereading Harry Potter

    I have some questions with no answers. Sirius found out after his brother Regulus died that he was killed by Voldemort or Death Eaters because he's…

  • Post a new comment

    Error

    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.
  • 3 comments