linux - Portable bourne shell script without using functions of modern shells as bash, ksh, zsh etc -
first of want thank of me solve this. have exam tomorrow , have prepare script exam. new linux , bourne shell script.
my project should portable bourne shell script scans directory following files: header.txt
, footer.txt
, content.txt
. content of files should read ignoring lines starting #
, content should used generating html page following header, footer , content. files can contain text and/or html code cannot contain head , body tags. when scanning directory script have compare date of last change of files (header.txt
, footer.txt
, content.txt
) date of last change of html page (if have 1 already) , if date of last edit on files newer 1 on html page script should generate new html page latest content.
guys thank very important me. please me getting done.
thank much!
to remove lines beginning #
try this:
grep -v "^#" file
to remove lines may contain spaces (or blank characters) before #
:
grep -v "^[[:blank:]]*#" file
Comments
Post a Comment