# Checking your .sh script for Bashisms



## rbelk (Mar 18, 2009)

I posted a tutorial on my site about checking your .sh scripts for bashisms. Here's the link Bashisms. Test it out to see if it works for yourself, any comments are welcome.


----------



## vermaden (Mar 18, 2009)

vermaden said:
			
		

> If you script works properly at FreeBSD or Solaris /bin/sh you do not need any further tools to confirm that
> 
> Also *avoiding linuxism* page from FreeBSD WIKI:
> http://wiki.freebsd.org/AvoidingLinuxisms



The checkbashisms also sometimes reports false alarms:

```
~/DEVSCRIPTS/usr/bin$ [color="Blue"]./checkbashisms ~/scripts/vergallery.sh [/color]
possible bashism in ~/scripts/vergallery.sh line 265 ($SECONDS):
      RESOLUTION="${MINUTES}:${SECONDS}"
```

while this line is 100% POSIX sh compatible.


----------

