Quantcast
Channel: Question and Answer » programming
Viewing all articles
Browse latest Browse all 103

Is there a tool that automatically inserts and updates a script header block for e.g. shell or Python scripts?

$
0
0

I found scripts by a former admin who scripted quite nice things with Bash or Python. All his scripts are well formatted and equipped with a always similar looking “script header” or “code header”, I would call it.

I wonder how he did this and if maybe there is a well known tool out there what inserts and automatically updates these sorts of “code headers”.

Any ideas / hints ?

Here is an example of such a code header block. It’s not Python only. It was found in many languages and Linux scripts:

#!/usr/bin/env python
# vim:fileencoding=utf-8
#
#   project-name
#   ~~~~~~~~~~~~~~
#
#   script description
#
#   * Intended to be run as a cron job.
#
#   Project title:      Back-Up Management
#
#   Project directory:  FileHost/project-name
#
#   Project documents:  xxxxx
#                       yyyyy
#                       zzzzz
#
#   Target OS:          Unix
#
#   Target interpreter: Python 2.5
#
#   File encoding:      UTF-8
#
#   2010-11-23  adminName     Created
#
#   2015-06-12  AdminName     CHANGE: some description
#
#   $Id: script-name.py 474 2010-12-10 12:16:36Z adminName $
#

Viewing all articles
Browse latest Browse all 103

Trending Articles