📜  bash 在 sed 命令中使用 cat - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:48.207000             🧑  作者: Mango

代码示例1
# Basic syntax:
sed 's//'"`cat replacement.txt`"'/' your_file
# Where:
#    - The replacement.txt file contains a single line that will be used
#        to replace the search_text, where found in your_file. 
# Note, this isn't very useful unless combined with other functions like
#        find exec, e.g.:
find *.txt -exec sed -i 's/search_text/'"`cat replacement.txt`"'/' {} \;