The following checks if thefirst line starts /*, if so and it ends */ then it is emptied but you could replace > with rm.<br><br><br>head -1 oldfile ¦ grep "^\/\*" > testfile <br>if [ -s testfile ] <br>then <br>tail -1 oldfile ¦ grep "\*\/$" > testfile<br>if [ -s testfile ] <br>then <br>> oldfile <br>echo "file initialised" <br>else <br>echo "file end ok" <br>fi <br>else <br>echo "file start ok" <br>fi<br><br>Note: About the sed option, loos like you missed a \/ <br>s/ : - s substitutes one string with another,<br>\/\/ : - \ tells the shell not to interpret what follows<br> so in this instance it looks for //<br>.* : - wild card, means all subsequent charecters <br> will be used.<br>// :- This sets the replacement string, as none was<br> entered then the 1st string is deleted.<br><br>I think this need to be incorporated in the script like this: -<br><br>head -1 oldfile ¦ grep "^\/\*" > testfile <br>if [ -s testfile ] <br>then <br>tail -1 oldfile ¦ grep "\*\/$" > testfile<br>if [ -s testfile ] <br>then <br>> oldfile # or touch oldfile or rm oldfile etc..<br>echo "file contents deleted" <br>else <br>echo "file end ok"<br>sed '/\/\/.*/d' <oldfile>newfile <br>fi <br>else <br>echo "file start ok"<br>sed '/\/\/.*/d' <oldfile>newfile <br>fi<br><br><br><br> <p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>