Date: Fri, 14 Nov 2008 22:20:26 +0100 From: Polytropon <freebsd@edvax.de> To: GESBBB <gesbbb@yahoo.com> Cc: FreeBSD Users Questions <freebsd-questions@freebsd.org> Subject: Re: root /etc/csh Message-ID: <20081114222026.16aa0add.freebsd@edvax.de> In-Reply-To: <875511.50099.qm@web32106.mail.mud.yahoo.com> References: <20081110110805.GK1302@obspm.fr> <20081110161002.GA81960@gizmo.acns.msu.edu> <20081110203643.GH27646@obspm.fr> <200811102235.46971.fbsd.questions@rachie.is-a-geek.net> <Pine.GSO.4.63.0811102239200.846@hmacs.cmi.ua.ac.be> <4ad871310811101530p7b2baa0fk7f7b5118e314c11d@mail.gmail.com> <4918CE42.3050504@ccstores.com> <20081111151302.GA86528@gizmo.acns.msu.edu> <20081112080616.2e195af5.freebsd@edvax.de> <20081112141407.0be011ae@scorpio> <20081114192856.GD9882@kokopelli.hydra> <875511.50099.qm@web32106.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 14 Nov 2008 11:49:35 -0800 (PST), GESBBB <gesbbb@yahoo.com> wrote: > The point is that I would want it to work seamlessly between > different flavors of *nix and FBSD. Since there seems to be > a lack of consistency as to where 'Bash' is installed on > different OSs, I find that using the notation I described > works best and seems to improve the portability of the scripts. > Since most of the scripts that I write are 'Bash' specific > anyway, the fact that it would not work if Bash was not > installed is of little importance. I'm not sure if you can assume /usr/bin/env exactly in this position on every UNIX system. In order to gain maximum portability, keep things simple and try to use sh as scripting shell. If that's not possible, you could add a check (using "which") for bash's availability, outputting to stderr if bash is not present, just like a kind of "wrapper script" that calls your bash specific script. Maybe that's not very elegant, but it seems to be a good solution. > By the way, this also works with Perl as you no doubt know. I > cannot count how many times I have installed a Perl script and > then had to modify the 'shebang' in order to get it to work in > FBSD. I know that I could probably make some symbolic links or > whatever; however, I feel that, that is the wrong way to get > things to work properly. That's correct. Adding symlinks to structures controlled by the package management system or the OS itself can lead into problems. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081114222026.16aa0add.freebsd>