#!/bin/bash

set -eu

ENV=$1

source "root/aws.bash"

#!/bin/bash

  • she-bang/sh-bang/hashbang/poundbang/hash-pling, from sharp(#) and bang(!)
  • tell the system which command interpreter should use

different command interpreter

#!/bin/sh :Executes the script using the Bourne shell or a compatible shell, with path /bin/sh

#!/bin/bash :Executes the script using the Bash shell.

set -eu

  • built-in shell command
  • set environment variables
  • -e: shell exits when the command fails
  • -u: treats unset or undefined variables as errors during parameter expansion

ENV=$1

  • positional parameters
  • $1 $2 $3 … : bash shell argument number : Used to get the specific argument from the script
$test.sh aa bb cc
#!/bin/sh
echo “File name is ” $0
echo “First arg. is ” $1
echo “Second arg. is ” $2
echo “Third arg. is ” $3

source “root/aws.bash”

  • built-in shell command
  • read and execute the content of a file
  • source FILENAME [arguments]