Always use sh(1) for scripts, bash(1) provides some fancy out of standart syntax and arrays. but for 99% cases its useless and can be achieved in plain sh(1).

... and welcome to bsdforums.org ... I mean daemonforums.org

__________________religions, worst damnation of mankind"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus TorvaldsLinux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.vermaden's:linksresourcesdeviantartspreadbsd

I agree with vermaden, this is a BSD forum... bash, as an optional package, should not be used by default.

Even in Linux in most cases the only avialable shell is bash(1) I always use only POSIX sh(1) sollutions, and they work very good.

Also it is possible to force bash(1) to behave like POSIX with --posix switch like that in scripts:

Code:

#! /bin/bash --posix

You can also use /usr/bin/env to point to bash(1), because bash(1) often lies in different PATH in systems other then Linux.

Code:

#! /usr/bin/env bash

__________________religions, worst damnation of mankind"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus TorvaldsLinux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.vermaden's:linksresourcesdeviantartspreadbsd