Multiple X Sessions on OSR 6

From: Bob Stockler (bob_at_trebor.iglou.com)
Date: 10/20/05

  • Next message: Jean-Pierre Radley: "Re: Multiple X Sessions on OSR 6"
    Date: 19 Oct 2005 20:26:02 -0400
    
    

    Bob Stockler wrote (on Wed, Oct 19, 2005 at 04:25:03PM -0400):

    | Roger Cornelius wrote (on Wed, Oct 19, 2005 at 11:37:41AM -0700):
    |
    | | That does eliminate the problems in my script, but at the expense of
    | | forking two additional processes (mine forks none). Can you do it
    | | without the additional processes (this IS meant to be a challenge :))?
    |
    | I'll have a look at using the .X?-lock files in /tmp and do it
    | all in the KornShell (even if I have to resort to ksh93).
    [much snipped above]

    Challenge accepted (no resort to ksh93 required).

    How does this look to you?

    #!/bin/ksh
    # @(#) xstart - Start X using the lowest unused session number.
    integer i j ; cd /tmp ; set -A xs .X*-lock ; cd -
    for i in 0 1 2 3 4 5 6 7 8 9
    do session=${xs[$i]} ; session=${session#".X"}
       session=${session%"-lock"} ; j=$session
       (( i != j )) && {
         echo "exec /usr/bin/startx -- :$i"
         exec /usr/bin/startx -- :$i
       }
    done

    Bob (who does his best work after cocktail hour begins)

    PS - I use a memory /tmp, so it gets removed after a reboot,
         and experimentation shows the ".X?-lock" files in it get
         removed if an X session is terminated. Others would have
         to maybe remove the .X*-lock files on reboot. I donno.

    -- 
    Bob Stockler  +-+  bob@trebor.iglou.com  +-+  http://members.iglou.com/trebor
    Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
    Fully functional (time-limited) demos available by email request (specify OS).
    -- 
    Bob Stockler  +-+  bob@trebor.iglou.com  +-+  http://members.iglou.com/trebor
    Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
    Fully functional (time-limited) demos available by email request (specify OS).
    

  • Next message: Jean-Pierre Radley: "Re: Multiple X Sessions on OSR 6"
  • Quantcast