![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Programming in unix | nivas | Shell Programming and Scripting | 3 | 02-13-2008 11:00 PM |
| shell programming in unix | nivas | Shell Programming and Scripting | 2 | 02-13-2008 10:44 PM |
| Check any MQ is up or down using shell programming | rinku | Shell Programming and Scripting | 1 | 08-09-2007 04:52 AM |
| Help with a shell script to concatenate lists together | rfourn | Shell Programming and Scripting | 1 | 07-05-2007 07:14 PM |
| good book for unix shell programming | ajaygodbole | Shell Programming and Scripting | 3 | 02-01-2002 06:49 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Check lists for Unix Shell Programming
Hi all,
Can anyone provide me any checklists or a list of steps I should follow before executing my scripts. Could also tell me if there are any other standards to be followed while shell programming like naming conventions for variables etc. Your help would be much appreciated. Regards, Srikanth. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
#3
|
||||
|
||||
|
Coding Standards
Here are few things I came up with :
Please suggest any changes that you feel necessary : 1. Header Each Shell script file will use this Header template at the top of the file. #######################< Shell Script>############### # Owner: # Application: # # Date: DD-MON-YYYY # File Name: # Author: # @(#) Description: # Parms: # Called By: # Output: # # Modification History: # # Change Date Name Description # ---------------------------------------------- # ################################################## 2. Commenting 1. Lines can be commented with a # (hash) 2. Make comments distinguishable from the code. 3. Make sure comments and the code match. 4. Never comment out a portion of the code without a comment describing why, who and when. If the need for the commented out code has expired, remove the commented out portion. 5. Comments should be indented to the level of the code they describe. 3. Modification Log Whenever a code is modified make sure that there is a modification log. A modification log is one which has the details of what has been modified, by whom and when. Include this detail along with the header. 4. Naming 1. All the constants and environment variable names should be in Capital letters. 2. All script variables must be lower case. 3. All the variable names should be meaningful. 4. All the function names should be related with the functionality of the code. 5. Don’t name the variable in single character (such as i,j,a), it will be tough to search the single character for code changes. 6. Don’t keep the keywords as variable or function names. |
||||
| Google The UNIX and Linux Forums |