Loading ...
Sorry, an error occurred while loading the content.

Re: [jasspa] wrapper script to choose the right me-image in multi-OS areas

Expand Messages
  • Thomas Hundt
    IMO you also need to check for X vs console and use the -n option accordingly. Here s some simple code: #!/bin/sh
    Message 1 of 2 , Jan 22, 2004
    • 0 Attachment
      IMO you also need to check for X vs console and use the '-n' option
      accordingly. Here's some simple code:

      #!/bin/sh
      #------------------------------------------------------------
      # me.sh Thundt rev 2 07-Jun-02
      # Wrapper around MicroEmacs; doesn't monopolize xterm
      #------------------------------------------------------------
      # Rename 'me' to 'me32'. Put this wrapper in ~/bin/me.
      # set -v
      # set -x
      if [ -z ${DISPLAY} ]; then
      me32 -n $* # no DISPLAY -> run termcap version (in fg)
      else
      if [ "$1" = "-n" -o "$2" = "-n" -o "$3" = "-n" -o "$4" = "-n" \
      -o "$5" = "-n" -o "$5" = "-n" -o "$6" = "-n" -o "$7" = "-n" \
      -o "$8" = "-n" -o "$9" = "-n" ]; then
      me32 $* # user requested non-X; run in fg
      else
      me32 $* & # X version; run in bg
      fi
      fi

      I run the X version in the background so as not to lose my prompt.


      -Th



      Dr. Detlef Groth wrote:

      > Hello,
      > if you like me work in different OS at the same time it is helpfull
      > to have a wrapper script which starts always the right me-image:
      >
      > here is an example:
      >
      > #!/bin/sh
      >
      > # Driver for platform-independant me-binary
      >
      > SYS=`uname -s`
      > DIR=`dirname $0`
      > case $SYS in
      > Linux) exec $DIR/me-linux "$@" ;;
      > OSF1) exec $DIR/me-alpha "$@" ;;
      > CYGWIN_NT-5.0) exec $DIR/me32.exe "$@" ;;
      > MINGW32_NT-5.0) start $DIR/me32.exe "$@" ;;
      > *) echo "Unknown system '$SYS'";;
      > esac
      >
      > Just check your `uname -s` and add it.
      >
      > regards,
      > Detlef
    Your message has been successfully submitted and would be delivered to recipients shortly.