printer_check

来自「UNIX[1].shell范例精解(第4版)_code」· 代码 · 共 23 行

TXT
23
字号
#!/bin/bash# Scriptname: printer_check# Script to clear a hung-up printerif [ $LOGNAME != root ]then	echo "Must have root privileges to run this program"	exit 1ficat << EOF  Warning: All jobs in the printer queue will be removed.  Please turn off the printer now. Press return when you  are ready to continue. Otherwise press Control C.EOFread JUNK      # Wait until the user turns off the printerecho/etc/rc.d/init.d/lpd stop       # Stop the printerecho -e "\nPlease turn the printer on now."echo "Press Enter to continue"read JUNK                # Stall until the user turns the printer                          # back onecho                     # A blank line is printed/etc/rc.d/init.d/lpd start     # Start the printer

⌨️ 快捷键说明

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