📄 prepend.sh
字号:
#!/bin/bash# prepend.sh: Add text at beginning of file.## Example contributed by Kenny Stauffer,#+ and slightly modified by document author.E_NOSUCHFILE=65read -p "File: " file # -p arg to 'read' displays prompt.if [ ! -e "$file" ]then # Bail out if no such file. echo "File $file not found." exit $E_NOSUCHFILEfiread -p "Title: " titlecat - $file <<<$title > $file.newecho "Modified file is $file.new"exit 0# from 'man bash':# Here Strings# A variant of here documents, the format is:# # <<<word# # The word is expanded and supplied to the command on its standard input.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -