⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fax

📁 使用efax的fax工具程序
💻
📖 第 1 页 / 共 2 页
字号:
		echo Fax files received in `pwd` :		echo		$LS -l [0-9]*.[0-9][0-9][0-9]		echo	fi	cd $FAXOUTDIR ;	case $? in 0) ;; *) echo "cannot cd to $FAXOUTDIR" ; break ;; esac	if $LS [0-9]*.[0-9][0-9][0-9] >/dev/null 2>/dev/null	then		echo		echo Fax files queued for send in `pwd` :		echo		$LS -l [0-9]*.[0-9][0-9][0-9]		echo	fi	break 	;;	# fax start/stop/status : manage fax receive daemon	start | stop | st* )		# common section	cd $FAXINDIR ; 	case $? in 0) ;; *) echo "cannot cd to $FAXINDIR" ; break ;; esac	if $LS ${DEVN}.[0-9]* >/dev/null 2>/dev/null ; then		logfile=`$LS ${DEVN}.[0-9]*|tail -1`	else		echo no fax answer process for device $DEV		break 	fi	efaxpid=`echo $logfile | sed -e "s/${DEVN}\.//g"`	case $cmd in# fax start - remove stop file so fax answer will continue	start)	if [ ! -w . ] ; then echo "can't write  `pwd`" ; break ; fi        $RM -f ${DEVN}.stop	break 	;;# fax stop - make a stop file and kill current fax answer daemon	stop)	if [ ! -w . ] ; then echo "can't write `pwd`" ; break ; fi	touch ${DEVN}.stop	echo stopping fax daemon for $DEV, pid=$efaxpid	kill -TERM $efaxpid	break 	;;# fax status - display pid and log file for current daemon	st*)	if [ -f ${DEVN}.stop ] ; then stat="(set to stop)" ; fi	echo "fax receive daemon for $DEV ${stat} ( log: $FAXINDIR/${logfile} )"	echo      	if ps -u $efaxpid 2>/dev/null ; then :      	else		echo "NOT ACTIVE (last was process $efaxpid)"      	fi	echo	egrep "Warning|Error|starts|activity|opened|received|done" $logfile	case $# in 	0) ;; *) echo "---------------" ; sleep $1 ; exec $FAX status $1 ;;	esac	break	;;	esac	# common section	;;# fax make : convert a text or Postscript file to fax format	m*)	case $# in 0) echo "No files specified" ; ERR=2 ; break ;; esac	if [ ! -r $1 ] ; then echo "Can't read $1" ; ERR=2 ; break ; fi	read x <$1	case $x in	%!*)	echo $1 is postscript		# GS can't deal with long paths so we 'cd'		DIRNAME=`dirname $1` ; BASENAME=`basename $1`		( cd $DIRNAME ; \		$GS -q -sDEVICE=dfax$res -dNOPAUSE -dSAFER \		-sOutputFile="|dd bs=32 skip=1 of=$BASENAME.%03d 2>/dev/null" \		$BASENAME </dev/null >/dev/null )		;;	*)	echo $1 is text		eval $EFIX -ve -itext -p$PAGEDIM $TEXTMARGIN \			\$TEXTSIZE$res -n $1.%03d $1		;;	esac	break	;;# fax send/poll : fax files to given number, converting first if necessary	s*|poll)		case $cmd in	poll) 	case $# in	0) echo "missing phone number to poll" ; ERR=2 ; break ;;	esac	;;	s*) 	case $# in	0|1) echo "missing phone number or file name(s)" ; ERR=2 ; break ;;	esac	;;	esac	# look up names	case $1 in [A-Za-z]*) 		for f in $DIRFILES ; do			if [ -r $f ] ; then TELNO=`$LOOKUP` ; fi			case "x$TELNO" in x) continue ;; *) break ;; esac		done		case "x$TELNO" in			x) echo "Name lookup for $1 failed" ; ERR=2 ; break ;;			*) echo "Lookup: $1 = $TELNO" ;;		esac		;;		*) TELNO="$1" ;;	esac	case "x$TO" in x) TO="$TELNO" ;; *) ;; esac	TELNO=`echo $TELNO|sed "s/[ 	()]*//g"`	# handle manual dialing and number->dial string conversions	case "$TELNO" in	-m*)	MANINIT="-iX3" ; TELNO="" ; shift ;;	+*)	eval TELNO=\"`echo $TELNO | $TELCVT`\" ; shift ;;	*) 	TELNO="$DIALPREFIX$TELNO$DIALSUFFIX" ; shift ;;	esac	case $cmd in	poll) 	efaxcmd="-p"	FILES="$*"	;;	*) 	efaxcmd="-t"	# use `fax make' to convert files if they need to be updated	FILES=""	for f in $* ; do		if [ ! -r $f ] ; then	      		echo "can't read file $f" ; ERR=2 ; break 2 		fi		case $f in		*.[0-9][0-9][0-9]) FILES="$FILES $f" ;;	# skip image files	   	*)	if echo ${f}.001: $f \; x | make -r -q -f - ; then				echo ${f}.nnn is up-to-date			else	 			$RM -f ${f}.[0-9][0-9][0-9]	 			/bin/sh $FAX make $RESSWITCH $f			fi			if [ -r $f.001 ] ; then                 		FILES="$FILES $f.[0-9][0-9][0-9]"	      		else		# something's wrong, catch it later	        		FILES="$FILES $f.001"	      		fi			;;		esac        done	# check that all files are OK	for f in $FILES ; do	   if [ ! -r $f ] ; then	      echo "can't read file $f" ; ERR=2 ; break 2 	   fi	done	;;	esac	# send it	for t in 0 $BUSYRETRIES ; do		case $t in 		0) ;; *) echo "Will try again in $t seconds" ; sleep $t ;;		esac		eval DATE=\"\`$HDRDATE\`\"		eval "HDR=\"$HDR\""		( trap "" $SIGNALS ; \		$NICE $EFAX -d/dev/$DEV -v "$VERB" $LOCK $INIT $SPKR \		$CLASSINIT $FCINIT $TXINIT \		-c "$VR,$TXCAP" -l "$FROM" $RESET \		-h "$HDR" \		$MANINIT $efaxcmd "$TELNO" $FILES \		2>&1 | tee $logfile )		if grep Error: $logfile >/dev/null ; then 			echo "There were errors (this log file is ${logfile})."			ERR=2 ; break		fi		if grep "is\ busy" $logfile >/dev/null ; then			echo Busy. ; ERR=1		else			ERR=0 ; break		fi	done	break 	;;# fax rm : delete files, possibly from spool directory	rm)		if $LS -l $FAXINDIR/$1 2>/dev/null ; then cd $FAXINDIR ; fi	$RM $1	break	;;# fax [receive] : answer phone now and receive fax files	r*)		case $# in 0) ;; *) TSTAMP=$1 ;	logfile=$FAXLOGDIR/${TSTAMP}.log ;; esac	( trap "" $SIGNALS ; \	$NICE $EFAX -d/dev/$DEV -v "$VERB" $LOCK $INIT $SPKR \	$CLASSINIT $FCINIT $RXINIT \	-c "$VR,$RXCAP" -l "$FROM" $RESET \	-r ${TSTAMP} \	2>&1 | tee $logfile )	if grep Error: $logfile >/dev/null ; then		echo "There were errors (this log file is ${logfile})."		ERR=2 ; break 	fi	if grep "session\ *98lpi" $logfile >/dev/null ;	then		echo " NOTE --> "		echo " NOTE --> ${TSTAMP}.nnn received at low resolution."		echo " NOTE --> "		echo " NOTE --> Use -l option to print, view or to re-send "		echo " NOTE --> "	fi	break	;;# fax cut : cut out part of a  fax	cut)	case $res in low) RES=204x98 ;; *) RES=204x196 ;; esac	case $# in 0|1|2|3|4) 		echo "missing argument(s)" 1>&2		cmd=help ; continue ;; 	esac	X=$1 ; shift ; Y=$1 ; shift ; W=$1 ; shift ; H=$1 ; shift	case "$1" in mm|"in"|cm|pt) UNITS=$1 ; shift ;; esac	$EFIX -d -${X},-${Y}$UNITS -p ${W}x${H}$UNITS -r$RES $1	break	;;# fax paste : paste one fax into others	paste)	case $res in low) RES=204x98 ;; *) RES=204x196 ;; esac	case $# in 0|1|2|3) 		echo "missing argument(s)" 1>&2		cmd=help ; continue ;; 	esac	X=$1 ; shift ; Y=$1 ; shift ; 	case "$1" in mm|"in"|cm|pt) UNITS=$1 ; shift ;; esac	OVFILE=$1 ; shift	for f in $* ; do		echo "$f ..."		if $EFIX -d ${X},${Y}$UNITS -r$RES $OVFILE | \			$EFIX -O- $f >efax.tmp		then			mv efax.tmp $f		fi	done	break	;;# fax print : print fax files, possibly from spool directory        p*) 	if $LS $FAXINDIR/$1 2>/dev/null ; then cd $FAXINDIR ; fi	eval RES=\$PRINT$res	for f in $*	do  		echo "$f ... "		eval "$PRINT | $PRCMD"	done	break	;;# fax view : display image, possibly from spool directory  	v*)		if $LS $FAXINDIR/$1 2>/dev/null ; then cd $FAXINDIR ; fi	eval RES=\$VIEW$res	for f in $* 	do  		echo "$f ... "		eval "$VIEW | $VIEWCMD"	done	break	;;# fax new : create a cover page for a fax (needs work)	new)	fname=${1-new.fax}	DATE=`date "+%B %d %Y"`	cat >$fname 2>/dev/null << EOF	________________________________________________			 FAX COVER PAGE	________________________________________________	 To:	x	fax:	________________________________________________	From:	$NAME	 fax:	$FROM	Date:	$DATE	Pages:	1 (including this page)	________________________________________________EOF	${VISUAL-{EDITOR-vi}} $fname	break	;;# fax test : make list of shell variables/values and modem features	t*)	sed -n -e '/^# --- End/q' -e '/^[A-Z]*\=/p' $0 	case "$CLASS" in	2.0) 	CMDS=" \	-i+FAA=?  -i+FAA? -i+FBO=?  -i+FBO? \	-i+FPI=?  -i+FPI? -i+FCQ=?  -i+FCQ? \	-i+FCR=?  -i+FCR? -i+FCC=?  -i+FCC? \	-i+FCS=?  -i+FCS? -i+FIS=?  -i+FIS? \	-i+FET=?  -i+FET? -i+FID=?  -i+FID? \	-i+FMM=?  -i+FMM? -i+FCT=?  -i+FCT? \	-i+FPS=?  -i+FPS? -i+FMR=?  -i+FMR? \	-i+FMI=?  -i+FMI? -i+FSP=?  -i+FSP? \	-i+FPP=?  -i+FPP? "	;;	2)	CMDS=" -i+FAA=?  -i+FAA? \	-i+FAXERR=?  -i+FAXERR?  -i+FBADLIN=?  -i+FBADLIN? \	-i+FBADMUL=?  -i+FBADMUL?  -i+FBOR=?  -i+FBOR? \	-i+FBUF?  -i+FBUG=?  -i+FBUG?  -i+FCIG=?  -i+FCIG? \	-i+FCQ=?  -i+FCQ?  -i+FCR=? -i+FCR?  -i+FDCC=?  -i+FDCC? \	-i+FDCS=?  -i+FDCS?  -i+FDIS=? 	-i+FDIS?  \	-i+FDT=?  -i+FECM=?  -i+FECM? \	-i+FET=?  -i+FET?  -i+FLID=?  -i+FLID?  -i+FMDL? -i+FMFR? \	-i+FMINSP=?  -i+FMINSP? -i+FPHCTO=?  -i+FPHCTO?  \	-i+FPTS=? -i+FPTS?  -i+FREL=? -i+FREL? -i+FREV? "	;;	1) 	CMDS="\	-i+FAE=? -i+FAE? \	-i+FTM=? -i+FRM=? \	-i+FTH=? -i+FRH=? \	-i+FTS=? -i+FRS=? "	;;	esac	for i in 1 2 3 ; do echo "Please wait..." 1>&2 ; sleep 2 ; done	$EFAX -vewica -d/dev/$DEV $LOCK $INIT $SPKR \	$CLASSINIT $FCINIT $TXINIT \	-iI0 -iI1 -iI3 -iI4 \	-i+FCLASS=? -i+FCLASS? \	$CMDS \	-i"&V" -i "" -i "" -i "" -i "" -i "" -z"Z" -oe -T 2>&1	echo "Done." 2>&1	break	;;	# fax help : show command arguments	-\?|\?|-h*|h*)cat 1>&2 <<EOF Usage:    fax [ r[eceive] [-l] [filename-prefix] ]   fax m[ake] [-l] { postscript-file-name | text-file-name }   fax s[end] [-l] { -m | telephone-number } filename...   fax { p[rint] | v[iew] | rm } [-l] filename...   fax cut x y w h [in|mm|cm|pt] filename    fax paste x y [in|mm|cm|pt] filename filename...   fax test   fax [ stop | start | st[atus] | q[ueue] ]   fax wait   fax answer [-l] use -l for low (96 lpi) resolution use -m if the number has been dialed manually 	 if given no arguments, answers the phone and receives a fax. use VAR=value to set variables (e.g. "fax DEV=cua2 receive") session logs are written to a file with the date/time as the file name and extension of .log (except for automatic reception). fax device is /dev/$DEV incoming fax directory is $FAXINDIR outgoing fax directory is $FAXOUTDIR fax log directory is $FAXLOGDIR EOF	ERR=1	break	;;	*)	echo "Error. Invalid command ($cmd)" ; ERR=2 ; break	;;esac	doneexit $ERR

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -