The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2005
srikanth_ksv's Avatar
Registered User
 

Join Date: May 2005
Location: Chennai
Posts: 14
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.
Reply With Quote
Forum Sponsor
  #2  
Old 08-05-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
There are some guidelines for scripting here:

http://www.shelldorado.com/
Reply With Quote
  #3  
Old 08-08-2005
srikanth_ksv's Avatar
Registered User
 

Join Date: May 2005
Location: Chennai
Posts: 14
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0