Skip to Content.
Sympa Menu

cat-users - Re: [[cat-users]] Error in eduroam-linux-UP1.sh

cat-users AT lists.geant.org

Subject: The mailing list for users of the eduroam Configuration Assistant Tool (CAT)

List archive

Re: [[cat-users]] Error in eduroam-linux-UP1.sh


Chronological Thread 
  • From: Jørn Åne <jorn.dejong AT uninett.no>
  • To: cat-users AT lists.geant.org
  • Subject: Re: [[cat-users]] Error in eduroam-linux-UP1.sh
  • Date: Wed, 20 Jan 2016 11:32:27 +0100

Den 20.01.2016 11.25, skrev Stefan Winter:
Hi,

#!/bin/bash

which is, as Wikipedia just told me, a "shebang":

https://en.wikipedia.org/wiki/Shebang_%28Unix%29

The article contains a portability section, and suggests to use:

#!/usr/bin/env bash

instead for higher chances of portability. Maybe this is worth a try? It
does work on my machine; but the raw /bin/bash also does here.

Hi Stefan

Management summary: This seems like a good idea, I support this.

For Linux operating systems, I think it doesn't really matter. Every Linux I know about supports both /bin/bash and /usr/bin/env bash.

It gets more interesting when the CAT installer must support other UNIXes as well, such as {Free,Net,Open}BSD. These operating systems come without bash built in, and if bash is installed using a package manager, it will generally not be located in /bin/bash, but rather somewhere like /usr/local/bin/bash or /usr/pkg/bin/bash.

This is the reason that using /usr/bin/env bash is more portable than /bin/bash. But keep in mind that even though using env is more portable,
the user still must have bash installed for the script to be able to run.

Example of a system without bash installed:
# /usr/bin/env bash
env: can't execute 'bash': No such file or directory
# /bin/bash
-sh: /bin/bash: not found

--
Jørn de Jong
Systemutvikler
UNINETT AS



Archive powered by MHonArc 2.6.19.

Top of Page