Improved portability by using /usr/bin/env pragma

This commit is contained in:
Joseph Dalrymple 2023-04-04 02:00:31 -05:00
parent 6dc284f05a
commit 53e3208ba0
12 changed files with 13 additions and 13 deletions

View File

@ -91,7 +91,7 @@ How to Use
If you only plan using strings and numbers, nothing could be simpler. In your shell script you can choose to export the variables. The below script is [`demo/using-strings`](demo/using-strings).
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory
export TEST="This is a test"
echo "Your message: {{TEST}}" | ../mo
@ -100,7 +100,7 @@ The result? "Your message: This is a test".
Using arrays adds a slight level of complexity. *You must source `mo`.* Look at [`demo/using-arrays`](demo/using-arrays).
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory
export ARRAY=( one two "three three three" four five )
. ../mo # This loads the "mo" function

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This embeds a template in the script without using strange `cat` syntax.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This sources a simple script with the env. variables needed for the template.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")"/..

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This sources a simple script with the env. variables needed for the template.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory
export ARRAY=( one two "three three three" four five )
. ../mo

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This example does not source `mo` and is intentionally restricted to
# variables that are not arrays.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This requires tomdoc.sh to be in your PATH.
# https://github.com/tests-always-included/tomdoc.sh

View File

@ -64,7 +64,7 @@ function runTest(test, done) {
var output, partials, script;
script = [
'#!/bin/bash'
'#!/usr/bin/env bash'
];
partials = test.partials || {};