端末とログファイルで異なるものを出力するためにbashスクリプトを取得しようとしましたが、使用するコマンドが不明です。例えば スクリーンとログファイルにBash出力が異なっています
、#!/bin/bash
freespace=$(df -h/| grep -E "/" | awk '{print $4}')
greentext="\033[32m"
bold="\033[1m"
normal="\033[0m"
logdate=$(date +"%Y%m%d")
logfile="$logdate"_report.log
exec > >(tee -i $logfile)
echo -e $bold"Quick system report for "$greentext"$HOSTNAME"$normal
printf "\tSystem type:\t%s\n" $MACHTYPE
printf "\tBash Version:\t%s\n" $BASH_VERSION
printf "\tFree Space:\t%s\n" $freespace
printf "\tFiles in dir:\t%s\n" $(ls | wc -l)
printf "\tGenerated on:\t%s\n" $(date +"%m/%d/%y") # US date format
echo -e $greentext"A summary of this info has been saved to $logfile"$normal
私はターミナルでそれを表示しながら、ログファイルの最後の出力(エコー「要約を...」)を省略したいと思います。そうするような命令はありますか?これを他のスクリプトに適用したいので、特定のスクリプトの代わりに一般的なソリューションを提供することができれば嬉しいです。
EDIT 1(> & 6を適用した後):
Files in dir: 7
A summary of this info has been saved to 20160915_report.log
Generated on: 09/15/16
ようこそ!サイト固有の詳細(バッジ)については、[ツアー](https://stackoverflow.com/tour)をチェックすることをお忘れなく。 – cxw