Automatically create script text header prompt

Time:2022-1-7

Automatically create script text header prompt

What is the most important? Find out what really needs to be done

#!/usr/bin/bash
# ================================================================================================== #
# SCRIPT_NAME	    :AUTO_HEADER
# USAGE		    :./AUTO_HEADER PROGRAM_NAME; eg: ./AUTOHEADER hello.sh
# NOTE		    :
# BUGS		    :
# DATE		    :Sun Dec 26 11:56:27 AM CST 2021
# AUTHOR	    :
# E-MAIL	    :
# VERSION	    :
# DESCRIPTION	    :
# OPTIONS	    :
# REQUIRENENTS	    :
# ORGNIZATION	    :
# ================================================================================================== #

cat << HEADER > 
# ================================================================================================== #
# SCRIPT_NAME       :
# USAGE             :
# NOTE              :
# BUGS              :
# DATE              :${DATE}
# AUTHOR            :
# E-MAIL            :
# VERSION           :
# DESCRIPTION       :
# OPTIONS           :
# REQUIRENENTS      :
# ORGNIZATION       :
# ================================================================================================== #
HEADER

chmod 755 

####################################################################################################

#!/usr/bin/bash
# ================================================================================================== #
# SCRIPT_NAME	    :AUTO_HEADER
# USAGE		    :./AUTO_HEADER PROGRAM_TYPE PROGRAM_NAME; eg: ./AUTOHEADER bash test
# NOTE		    :only support bash/perl/python/go/tcl/verilog/vhdl,default use "#" to 
#		     comment
# BUGS		    :
# DATE		    :Sun Dec 26 11:56:27 AM CST 2021
# AUTHOR	    :
# E-MAIL	    :
# VERSION	    :
# DESCRIPTION	    :
# OPTIONS	    :
# REQUIRENENTS	    :
# ORGNIZATION	    :
# ================================================================================================== #

extension=""

DATE=`date`

case  in

    bash)       extension='sh';;
    perl)       extension='pl';;
    python)     extension='py';;
    go)         extension='go';;
    tcl)        extension='tcl';;
    verilog)    extension='v';;
    vhdl)       extension='vhd';;
    *)          echo "SORRY,NOT SUPPORT THIS PROGRAM YET!"
		exit
esac

cat << HEADER > .${extension}
# ================================================================================================== #
# SCRIPT_NAME       :.${extension}
# USAGE             :
# NOTE              :
# BUGS              :
# DATE              :${DATE}
# AUTHOR            :
# E-MAIL            :
# VERSION           :
# DESCRIPTION       :
# OPTIONS           :
# REQUIRENENTS      :
# ORGNIZATION       :
# ================================================================================================== #
HEADER

chmod 755 .${extension}

Recommended Today

Proper memory alignment in go language

problem type Part1 struct { a bool b int32 c int8 d int64 e byte } Before we start, I want you to calculatePart1What is the total occupancy size? func main() { fmt.Printf(“bool size: %d\n”, unsafe.Sizeof(bool(true))) fmt.Printf(“int32 size: %d\n”, unsafe.Sizeof(int32(0))) fmt.Printf(“int8 size: %d\n”, unsafe.Sizeof(int8(0))) fmt.Printf(“int64 size: %d\n”, unsafe.Sizeof(int64(0))) fmt.Printf(“byte size: %d\n”, unsafe.Sizeof(byte(0))) fmt.Printf(“string size: %d\n”, […]