字号:
#! /bin/csh -f##- print - print file(s) to line printer (with sf interface)#-# Author: Paul Lew, General Systems Group, Salem, NH# Created at: 5/8/86# Last update: 01/27/88 00:03 AM (Edition: 11)##- Usage: Print filenames <CR>#---------------------------------------------------------------## Display help if requested by user ##---------------------------------------------------------------#switch ( "$1" ) case -H[xX]: set echo; set verbose; shift breaksw case -H*: show_help `which $0` $1 goto end default: endsw#---------------------------------------------------------------## Display form to take input from the user ##---------------------------------------------------------------#set srcfile = "/tmp/form.$$"sf -o ${srcfile} -u <<! General Systems Group Fast Printer Spooler File Name: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [-#] Number of copies: ~~~ [-h] Burst Header Page: ~~~ [-m] Send mail on completion: ~~~ [-p] Format with pr: ~~~ [-J] Job Name: ~~~~~~~~~~~~~ [-C] Class Name: ~~~~~~~~~~~~~ [-T] Title for pr: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current Print Queue Status`lpq | head -5` [Press TAB to move to next field, RETURN to execute]v=fnd=$*v=copya=add=1v=bursts=/Yes/Noa=av=mails=/No/Yesa=av=prs=/Yes/Noa=av=jobd=$1v=classd=`hostname`v=titled=$1!#---------------------------------------------------------------## Execute script to set variables from form ##---------------------------------------------------------------#if ( ! -e ${srcfile} ) goto endsource ${srcfile}#---------------------------------------------------------------## Re-arrange variables before execution ##---------------------------------------------------------------#if ( "${copy}" != "1" ) then set copy = "-#${copy}"else set copy = '' endif#if ( "${burst}" != "Yes" ) then set burst = "-h"else set burst = '' endif#if ( "${pr}" == "Yes" ) then set pr = "-p"else set pr = '' endif#if ( "${mail}" == "Yes" ) then set mail = "-m"else set mail = '' endif#set tf; set cf; set jfif ( "${title}" != "" ) set tf = "-T"if ( "${class}" != "" ) set cf = "-C"if ( "${job}" != "" ) set jf = "-J"#---------------------------------------------------------------## Execute proper command .... ##---------------------------------------------------------------#if ( "${fn}" != "" ) then lpr ${copy} ${burst} ${pr} ${mail} ${tf} "${title}" \ ${cf} "${class}" ${jf} "${job}" ${fn} endif/bin/rm -f ${srcfile}end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -