watch.sh

来自「unix linux 编程实践源代码」· Shell 代码 · 共 16 行

SH
16
字号
#!/bin/sh##  watch.sh  - a simple version of the watch utility, written in sh#	who | sort > prev		# get initial user list	while true			# true is a program: exit(0);	do		sleep 30		# wait a while		who | sort > current	# get current user list		echo "Logged out:"	# print header		comm -23 prev current	# and results		echo "Logged in:"	# header		comm -13 prev current   # and results		mv current prev		# make now past	done

⌨️ 快捷键说明

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