I've been working on a little script that searches my media server for .nfo files, extracts the title and plot information from said .nfo files and write the data to a txt file.
This is what I've got so far
- Code: Select all
IFS=$'\n'
cd /home/$USER/Network/server/Videos/$1
for file in $( find . -iname '*.nfo' );
do cat $file | grep -e '<title>' -e '<plot>' >> ~/movielist.txt
done
I'am trying to make the output easier to read by putting a newline or line of ================= between the plot and the next title.
Sample output:
- Code: Select all
<title>Corpse Bride</title>
<plot>Set in a 19th-century european village, this stop-motion animation feature follows the story of Victor, a young man whisked away to the underworld and wed to a mysterious corpse bride, while his real bride Victoria waits bereft in the land of the living.</plot>
<title>WALL·E</title>
<plot>WALL-E is the last robot left on an Earth that has been
What I would like is :
- Code: Select all
<title>Corpse Bride</title>
<plot>Set in a 19th-century european village, this stop-motion animation feature follows the story of Victor, a young man whisked away to the underworld and wed to a mysterious corpse bride, while his real bride Victoria waits bereft in the land of the living.</plot>
<title>WALL·E</title>
<plot>WALL-E is the last robot left on an Earth that has been
I have been trying to add an echo line to the script, but I'm not sure if echo is the right command to use or even where to put it.
Could anyone suggest how I could amend the script?
Thanks
PP