I have to create a script on RHEL and was wondering if I am able to save the output of a command as a variable. For example:
4.2.2 Ensure logging is configured (Not Scored) : = OUTPUT (which comes from the command sudo cat /etc/rsyslog.conf
)
This is what I have now.
echo " ### 4.2.2 Ensure logging is configured (Not Scored) : ### "
echo " "
echo "Running command: "
echo "#sudo cat /etc/rsyslog.conf"
echo " "
sudo cat /etc/rsyslog.conf
Thank you!