1. Latest News
  2. Submit Press Release
  1. PR Home
  2. Latest News
  3. Feeds
  4. Alerts
  5. Submit Free Press Release
  6. Journalist Account
  7. PRNewswire Distribution

How to successfully debug a shell Script | Sedulity Groups

How to successfully debug a shell Script | Sedulity Groups How to successfully debug a shell Script | Sedulity Groups

FOR IMMEDIATE RELEASE

 
PRLog (Press Release) - Sep. 19, 2012 - Debugging a shell script is very essential to check your script for any errors. There are different debugging tips and tricks useful for running your scripts
without any flaw.

   In order to minimize the errors we should write shell scripts in a
   proper way.
   When executing a shell script use sh command with below
   options to debug a shell script in effective way.

   -x if you set this option, it will show you each
   line before it executes it. Comments will not be reported.

For example: sh –x scriptname

   -v Echo’s each line as it is read. It’s a kind
   of verbose and even echo back commented lines too.

For
Example: sh –v scriptname
Note: A small difference between –x and –v is
that –v echo’s the line as it is read (So it will even
display comments too.), whereas –x flag causes each command to be
echoed as it is executed.


For Example: sh –xv scriptname

   -u –At times you use a variable without setting
   some value to it. If you use this flag it will give you the error
   saying so and so variable is not set before executing the script.
   -e –Exit the shell script if any error occurs.
   This option will stop the script to run further once the script
   encounters an error. Use full for debugging the first error
   itself when running big scripts…


For
Example: sh –e scriptname

   Always use vim editor to get the syntax error at the time of editing
   the script itself.
   Place
   brackets in a meaning full way using tabs.
   Try to read and understand the script before running a script.
   Try
   to give as many comments as possible for better understanding of the
   script.

--- End ---

Click to Share

Contact Email:
***@sedulitygroups.com Email Verified
Source:www.cybertimes.in
City/Town:All Over India
State/Province:Delhi
Country:India
Industry:Technology
Tags:Commands, , , ,
Shortcut:http://prlog.org/11978567
Disclaimer:   Issuers of the press releases are solely responsible for the content of their press releases. PRLog can't be held liable for the content posted by others.   Report Abuse

Latest Press Releases By “

More...

Upcoming Press Releases...



  1. SiteMap
  2. Privacy Policy
  3. Terms of Service
  4. Copyright Notice
  5. About
  6. Advertise
Like PRLog?
8.4K1.9K2.6K
Click to Share