dtlpsetup.src 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. XCOMM!/bin/sh
  2. XCOMM
  3. XCOMM $XConsortium: dtlpsetup.src /main/3 1996/04/23 12:01:59 drk $
  4. XCOMM
  5. XCOMM COMPONENT_NAME: desktop
  6. XCOMM
  7. XCOMM FUNCTIONS: dtlpsetup
  8. XCOMM
  9. XCOMM ORIGINS: 27
  10. XCOMM
  11. XCOMM (C) COPYRIGHT International Business Machines Corp. 1995
  12. XCOMM All Rights Reserved
  13. XCOMM US Government Users Restricted Rights - Use, duplication or
  14. XCOMM disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  15. XCOMM
  16. XCOMM
  17. XCOMM Add /usr/dt/lib/nls/msg/%L/%N.cat to NLSPATH
  18. XCOMM
  19. NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat:$NLSPATH
  20. export NLSPATH
  21. usage="$0 [-b banner_title] [-d lpdest] [-f print_file]
  22. [-m print_command] [-n copy_count] [-o other_options]
  23. [-u user_filename] [-a] [-e] [-h] [-r] [-s] [-v] [-w]"
  24. while [ $# -gt 0 ]; do
  25. case "$1" in
  26. -b)
  27. if [ "$2" ]; then
  28. banner_title="$1 $2"
  29. shift; shift;
  30. else
  31. echo "$usage" 1>&2
  32. exit 2
  33. fi
  34. ;;
  35. -b*)
  36. banner_title="-b $(expr "$1" : '-b\(.*\)')"
  37. shift
  38. ;;
  39. -d)
  40. if [ "$2" ]; then
  41. lpdest="$1 $2"
  42. shift; shift;
  43. else
  44. echo "$usage" 1>&2
  45. exit 2
  46. fi
  47. ;;
  48. -d*)
  49. lpdest="-d $(expr "$1" : '-d\(.*\)')"
  50. shift
  51. ;;
  52. -c)
  53. NOT_SUPPORTED=true
  54. ARGS="$ARGS $1"
  55. if [ "$2" ]; then
  56. shift; shift;
  57. else
  58. shift
  59. fi
  60. ;;
  61. -c*)
  62. NOT_SUPPORTED=true
  63. ARGS="$ARGS -c"
  64. shift
  65. ;;
  66. -t)
  67. NOT_SUPPORTED=true
  68. ARGS="$ARGS $1"
  69. if [ "$2" ]; then
  70. shift; shift;
  71. else
  72. shift
  73. fi
  74. ;;
  75. -t*)
  76. NOT_SUPPORTED=true
  77. ARGS="$ARGS -t"
  78. shift
  79. ;;
  80. -i)
  81. NOT_SUPPORTED=true
  82. ARGS="$ARGS $1"
  83. if [ "$2" ]; then
  84. shift; shift;
  85. else
  86. shift
  87. fi
  88. ;;
  89. -i*)
  90. NOT_SUPPORTED=true
  91. ARGS="$ARGS -i"
  92. shift
  93. ;;
  94. -l)
  95. NOT_SUPPORTED=true
  96. ARGS="$ARGS $1"
  97. if [ "$2" ]; then
  98. shift; shift;
  99. else
  100. shift
  101. fi
  102. ;;
  103. -l*)
  104. NOT_SUPPORTED=true
  105. ARGS="$ARGS -l"
  106. shift
  107. ;;
  108. -f)
  109. if [ "$2" ]; then
  110. print_file=$2
  111. shift; shift;
  112. else
  113. echo "$usage" 1>&2
  114. exit 2
  115. fi
  116. ;;
  117. -f*)
  118. print_file=$(expr "$1" : '-f\(.*\)')
  119. shift
  120. ;;
  121. -m)
  122. if [ "$2" ]; then
  123. print_command="$1 $2"
  124. shift; shift;
  125. else
  126. echo "$usage" 1>&2
  127. exit 2
  128. fi
  129. ;;
  130. -m*)
  131. print_command="-m $(expr "$1" : '-m\(.*\)')"
  132. shift
  133. ;;
  134. -n)
  135. if [ "$2" ]; then
  136. copy_count="$1 $2"
  137. shift; shift;
  138. else
  139. echo "$usage" 1>&2
  140. exit 2
  141. fi
  142. ;;
  143. -n*)
  144. copy_count="-n $(expr "$1" : '-n\(.*\)')"
  145. shift
  146. ;;
  147. -o)
  148. if [ "$2" ]; then
  149. other_options="$1 $2"
  150. shift; shift;
  151. else
  152. echo "$usage" 1>&2
  153. exit 2
  154. fi
  155. ;;
  156. -o*)
  157. other_options="-o $(expr "$1" : '-o\(.*\)')"
  158. shift
  159. ;;
  160. -u)
  161. if [ "$2" ]; then
  162. user_filename="$1 $2"
  163. shift; shift;
  164. else
  165. echo "$usage" 1>&2
  166. exit 2
  167. fi
  168. ;;
  169. -u*)
  170. user_filename="-u $(expr "$1" : '-u\(.*\)')"
  171. shift
  172. ;;
  173. -a)
  174. a=$1
  175. shift
  176. ;;
  177. -e)
  178. e=$1
  179. shift
  180. ;;
  181. -r)
  182. r=$1
  183. shift
  184. ;;
  185. -s)
  186. s=$1
  187. shift
  188. ;;
  189. -v)
  190. v=$1
  191. shift
  192. ;;
  193. -w)
  194. w=$1
  195. shift
  196. ;;
  197. -*)
  198. echo "$usage" 1>&2
  199. exit 2
  200. ;;
  201. *)
  202. break
  203. ;;
  204. esac
  205. done
  206. if [ $# -gt 0 ]; then
  207. echo "$usage" 1>&2
  208. exit 2
  209. fi
  210. if [ $NOT_SUPPORTED ]; then
  211. dspmsg -s 1 dtmigrate 2 "dtlpsetup: dtlpsetup has been replaced with dtlp.\
  212. \tdtlp will be automatically called in its place. \
  213. \tThe following flags and parameters on the dtlpsetup call \
  214. \thave been ignored because dtlp does not support these flags: \
  215. \t%1$s \n" "$ARGS"
  216. fi
  217. /usr/dt/bin/dtlp "$banner_title" "$lpdest" "$print_command" "$copy_count" "$other_options" "$user_filename" "$a" "$e" "$h" "$r" "$s" "$v" "$w" "$print_file"
  218. status=$?
  219. XCOMM dtlp return code of 5 maps to return code 7 of dtlpsetup
  220. if [ $status -eq 5 ]
  221. then exit NO_VALID_FILE_ERR
  222. XCOMM dtlp return code of 6 maps to return code 8 of dtlpsetup
  223. elif [ $status -eq 6 ]
  224. then exit NO_READ_FILE_ERR
  225. else
  226. XCOMM all others are synonomous
  227. exit $status
  228. fi