我有一个程序,使用printf一些tput在它混合,我想管道输出到stdout和文件。我更喜欢使用,sed因为我不希望对我的脚本有任何不必要的依赖。这是我到目前为止所得到的。
printf "\n$(tput setaf 6)| $(tput sgr0)$(tput setaf 7)Sourcing files...\033[m\n" | tee install.log
唯一的问题是我的日志文件正在获取所有颜色输出...
^[[36m| ^[(B^[[m^[[37mSourcing files...^[[m
我希望它只是有 | Sourcing files...