overwrite.sh

来自「su 的源代码库」· Shell 代码 · 共 37 行

SH
37
字号
#! /bin/sh# /*********************** self documentation **********************/# OVERWRITE - copy stdin to stdout after EOF## This shell is called from the shell script:    replace## /**************** end self doc ********************************/# Kernighan and Pike - page 154opath=$PATHPATH=/bin:/usr/bin:/usr/ucbcase $# in0|1)	echo 'Usage: overwrite file cmd [args]' 1>&2	exit 2esacfile=$1; shiftnew=./overwr.$$trap 'rm -f $new; exit 1' 1 2 15if	PATH=$opath "$@" >$newthen	trap '' 1 2 15	cp $new $fileelse	echo "overwrite: $1 failed, $file unchanged" 1>&2	exit 1firm -f $newexit 0

⌨️ 快捷键说明

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