I am trying to save a random line from a file to a variable ($fortune), that part is easy. The part that I am having trouble with is the "line" can be multiple lines. Every line will end with \n% (enter key plus %). How would I get this to a variable? An example of the file is below:
"There is a wiki on iptables http://en.wikipedia.org/wiki/Iptables and don't mess around with iptables - it's really tricky"
Husse Mar 15 2007
%
"The Ubuntu developers have gone to great lengths to make sudo as smooth as possible in the GUI environment, and they've done a very good job. By re-enabling the root user and even logging in as root, you literally throw their work out the window, take your safety belt off and drive head-on into traffic. Yes, it is a bit insane.."
Husse Mar 20 2007
%
(It would pick everything before a "%")