⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prepend.sh

📁 Shall高级编程
💻 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 + -