LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-31-2009, 11:35 AM   #1
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, grml
Posts: 210

Rep: Reputation: 33
Finding bugs in bash scripts, Analyis tool for bash


Is there a tool available to verify shell scripts? As an example for other languages like Java there exist some nice tools to integrate into eclipse(, like PMD). Source code analysis

The Java compiler itself checks for several issues.

They find 'patterns of errors' which should be avoided, something like:
- obsolete API call used
- return value not used
- etc.
 
Old 10-31-2009, 12:06 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,771

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
The bash debugger:
http://bashdb.sourceforge.net/
 
Old 10-31-2009, 12:42 PM   #3
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
I use this to sanitize the environment:
Code:
   source "/etc/profile" > /dev/null
   set -eu
   shopt -s nullglob dotglob
   IFS=$'\n\t'
   umask 022
   unalias -a
   unset -f $(declare -F | sed "s/^declare -f //")
set -eu is a huge step towards writing reliable and robust bash scripts by using the "fail fast" approach.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Bash scripts greengrocer Linux - Newbie 16 06-04-2009 09:59 AM
Need some help with BASH scripts mcdcyex Linux - Newbie 13 04-01-2008 12:50 PM
I need some help with BASH scripts. BoB4ik Programming 10 12-20-2007 05:06 PM
$? in Bash scripts clinton Linux - Newbie 4 02-20-2004 12:15 PM
Bash scripts? BajaNick Programming 3 07-05-2003 11:13 PM


All times are GMT -5. The time now is 11:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration