Trying to create a small script capable of writing part of a script to an output file without any changes (as is)
source file text
echo " yellow=`tput setaf 3` bel=`tput bel` red=`tput setaf 1` green=`tput setaf 2` reset=`tput sgr0 echo"#${green}Installing packages${reset}#" && " >> output.txt
Required Conclusion:
yellow=`tput setaf 3` bel=`tput bel` red=`tput setaf 1` green=`tput setaf 2` reset=`tput sgr0 echo"#${green}Installing packages${reset}#" &&
I get:
yellow=^[[33m bel=^G red=^[[31m green=^[[32m reset=^[(B^[[m echo"#${green}Installing packages${reset}#" &&
Using CentOS 7 Minimum new installation If you are looking for a solution that will be applied to the full script / text, the line will not change, I think it can be done with sed ...
source share