这是我更新的脚本: #!/bin/bashOUT=/tmp/output.txt ## in memory here docs ## thanks https://twitter.com/freebsdfrauexec9<<EOFStatusof backupason $(date)Backingup files$HOMEand/etc/EOF## continueecho"Starting my script..."echo"Doing something..."##doitcat<&9>$OUTecho"Starting backup...
find . -maxdepth 1 -type f | sed -i 's/A/B/g'
以下脚本将所需内容写入名为/tmp/output.txt的文件中: #!/bin/bashOUT=/tmp/output.txt echo "Starting my script..."echo "Doing something..." cat <$OUT Status of backup as on $(date) Backing up files $HOME and /etc/EOF echo "Starting backup using rsync..." 你可以使用cat命令查看/tmp/...