FORTRAN System Interface Routine Library

David M. McQueen mcqueen at acf4.NYU.EDU
Thu Oct 19 23:17:00 AEST 1989


c 
c     this fragment determines what type of terminal you are logged in on 
c     using the getenv routine. the purpose is to prevent inadvertently 
c     running graphics when you are not (and somebody else is) at the 
c     IRIS console. this may not be elegant, but it works. 
c 
      character*80 terminal 
c 
      do 101 iterm=1,80
      terminal(iterm:iterm) = ' '
  101 continue
      call getenv('TERM',terminal)
      if (terminal .ne. 'iris-ansi') then
        do 103 iterm=1,80
        lterm = iterm
        if (terminal(iterm:iterm) .eq. ' ') go to 104
  103   continue
  104   lterm = lterm - 1
        if (lterm .lt. 10) then
          write(fm,111) lterm
        else
          write(fm,112) lterm
        end if
  111   format('(a',i1,',a52)')
  112   format('(a',i2,',a52)')
        write(6,*)
        write(6,fm) terminal(1:lterm),
     c      ' is an inappropriate terminal type for IRIS graphics'
        write(6,*)
        stop
      end if



More information about the Comp.sys.sgi mailing list