I have a file name foo. That file contains some text (shown below). Can you please tell me how can I get the string “I have not created a home page.” into a variable. I was using the command variable='cat foo | cut -d ">" -f 3'. It output “I have not created a home page.” with lots of new lines in it. Please let me know if you can tell me a way to obtain the string without any newlines. Thanks a lot.
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html>
<META HTTP-EQUIV="resource-type" CONTENT="document">
</HEAD>
<BODY>
I have not created a home page.
</BODY>
</HTML>
cat foo | grep "^[^<]". To assign a variable: