convertVS.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. # * *
  3. # * (c) Copyright 1993, 1994 Hewlett-Packard Company *
  4. # * (c) Copyright 1993, 1994 International Business Machines Corp. *
  5. # * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
  6. # * (c) Copyright 1993, 1994 Novell, Inc. *
  7. # *
  8. #######################################################################
  9. #
  10. # convertVS.sh
  11. #
  12. # The shell-script which converts a DT 2.0 dt.session file
  13. # to a DT 3.0 dt.session file. This file is intended to
  14. # only be executed by dtsession.
  15. #
  16. # Hewlett-Packard Visual User Environment
  17. #
  18. # Copyright (c) 1991, 1992 Hewlett-Packard Company
  19. #
  20. # @(#) $XConsortium: convertVS.sh /main/3 1995/10/30 09:40:46 rswiston $
  21. #
  22. ######################################################################
  23. # Usage: convertVS.sh <session_file>
  24. if [ $# -eq 1 ]
  25. then
  26. if [ -r $1 ]
  27. then
  28. # ---- get the local clients
  29. grep -v host $1 >$1T1
  30. # ---- get the remote clients ----
  31. grep host $1 >$1T2
  32. # ---- change /usr/bin/X11/<client> to /usr/dt/bin/<client> ----
  33. # for local clients $1T1 ----
  34. sed 's/\/usr\/bin\/X11\/hpterm/\/usr\/dt\/bin\/hpterm/g
  35. s/\/usr\/bin\/X11\/xload/\/usr\/dt\/bin\/xload/g' $1T1 > $1T3
  36. # ---- preserve old dt.session file ----
  37. cp $1 $1.20
  38. # ---- put local clients first in file ----
  39. cat $1T3 $1T2 >$1TMP
  40. # ---- remove the temporary files ----
  41. rm -f $1T1 $1T2 $1T3
  42. # ---- make this our new dt.session ----
  43. mv -f $1TMP $1
  44. exit 0
  45. else
  46. exit 1
  47. fi
  48. else
  49. exit 1
  50. fi