stderr-after-eof.sh

来自「OpenSSH 是 SSH (Secure SHell) 协议的免费开源实现。它」· Shell 代码 · 共 41 行

SH
41
字号
#	$OpenBSD: stderr-after-eof.sh,v 1.1 2002/03/23 16:38:09 markus Exp $#	Placed in the Public Domain.tid="stderr data after eof"DATA=/etc/motdDATA=${OBJ}/dataCOPY=${OBJ}/copyif have_prog md5sum; then	CHECKSUM=md5sumelif have_prog openssl; then	CHECKSUM="openssl md5"elif have_prog cksum; then	CHECKSUM=cksumelif have_prog sum; then	CHECKSUM=sumelse	fatal "No checksum program available, aborting $tid test"fi# setup datarm -f ${DATA} ${COPY}cp /dev/null ${DATA}for i in 1 2 3 4 5 6; do	(date;echo $i) | $CHECKSUM >> ${DATA}done${SSH} -2 -F $OBJ/ssh_proxy otherhost \	exec sh -c \'"exec > /dev/null; sleep 2; cat ${DATA} 1>&2 $s"\' \	2> ${COPY}r=$?if [ $r -ne 0 ]; then	fail "ssh failed with exit code $r"fiegrep 'Disconnecting: Received extended_data after EOF' ${COPY} &&	fail "ext data received after eof"cmp ${DATA} ${COPY}	|| fail "stderr corrupt"rm -f ${DATA} ${COPY}

⌨️ 快捷键说明

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