I have the following command:
egrep -e "\\\\" pom.xml | egrep -v -e "\\\\$" I want to assign it to a variable so that I can echo it later in this code:
egrep -e "\\\\" pom.xml | egrep -v -e "\\\\$" &> /dev/null if [ $? == 0 ]; then echo "Errors in POM were found" echo "line matches (result of the command)" fi