Hi all
I have a little problem with bourne shell. I've just started writing that kind of scripts
I have to write a script that search in folder for header.txt, footer. and content.txt. If these files exists i have to copy the content from them (ignoring the lines with #) and generate HTML file with this content where the content from file footer.txt goes between footer tags, the text from header.txt in header tags and content between them. After that I have to check date of the files. If the tree files are newer than the HTML i have to generate a new one , if not to exit the script. In the three files (header.txt, footer. and content.txt) i can have all kind of text withoth head and body tags.
#!/bin/sh
echo "Enter folder path: "
read path
cd
cd $path
file1="header.txt"
file2="footer.txt"
file3="content.txt"
file4="project.html"
if [ -e $file1 ]
then echo "Header.txt exists"
else echo "Header.txt doesn't exists"
fi
if [ -e $file2 ]
then echo "Footer.txt exists"
else echo "Footer.txt doesn't exists"
fi
if [ -e $file3 ]
then echo "Content.txt exists"
else echo "Content.txt doesn't exists"
fi
if [ -e $file4 ]
then //if file exists i have to check the modify dates and if the HTML file is older than the other 3 to I have to create a new HTML else to exit
else //if the file doesn't exist to create one
fi
Can anyone help me , please
Thank you in advance