ex69.sh

来自「Shall高级编程」· Shell 代码 · 共 34 行

SH
34
字号
#!/bin/bash# Non-interactive use of 'vi' to edit a file.# Emulates 'sed'.E_BADARGS=65if [ -z "$1" ]then  echo "Usage: `basename $0` filename"  exit $E_BADARGSfiTARGETFILE=$1# Insert 2 lines in file, then save.#--------Begin here document-----------#vi $TARGETFILE <<x23LimitStringx23iThis is line 1 of the example file.This is line 2 of the example file.^[ZZx23LimitStringx23#----------End here document-----------##  Note that ^[ above is a literal escape#+ typed by Control-V <Esc>.#  Bram Moolenaar points out that this may not work with 'vim',#+ because of possible problems with terminal interaction.exit 0

⌨️ 快捷键说明

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