![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| insertion sort??? | sogpop | UNIX for Dummies Questions & Answers | 2 | 04-16-2008 10:20 PM |
| Reading the header of a tar file(posix header) | Tanvirk | Linux | 2 | 01-31-2008 08:50 AM |
| Remove & insertion of data in a same file | videsh77 | Shell Programming and Scripting | 10 | 03-01-2007 06:27 AM |
| problem with Unicode characters insertion | suman_jakkula | AIX | 0 | 02-11-2006 01:20 AM |
| Insertion of Leap Second | isingh786 | UNIX for Advanced & Expert Users | 2 | 12-28-2005 02:05 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
automatic header insertion
hi
Is there any way to automatically insert a predefined header into a file? It would include the file name, author name, date and a description, the description entered on the first line of vi. Thanks for any help Oliver |
|
||||
|
No problem!
Code:
#!/bin/bash AUTHOR=`grep $USER /etc/passwd | cut -d":" -f5` DATE=`date '+%Y/%m/%d'` read DESCRIPTION cat << END #!/bin/sh #################################### ## Program : $1 ## Author : $AUTHOR ## Date : $DATE ## Description : $DESCRIPTION ################################### END |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|