I must be missing something about include external file to my bash file.
In my scenario I have the following command
sh exec.sh env_local.conf ebis_tag
It showed the error
exec.sh: line 30: .: env_local.conf: file not found
My following exec.sh script is:
#!/bin/bash
usage_exit() {
echo "Usage: $0 [-b] env_file_path project_name" 1>&2
exit 1
}
# default BANG_RUNNING="FALSE"
BANG_RUNNING="FALSE"
while getopts b OPT
do
case $OPT in
b) BANG_RUNNING="TRUE" ;;
¥?) usage_exit;
esac
done
shift $(($OPTIND - 1))
if [ $# -ne 2 ]; then
echo $#;
usage_exit;
fi
# import env_file
# CORE_HOST
# REF_HOST
# ADMASTER_HOST
. $1
exec.sh and env_local.config are in same directory
[root@6d4f1e2363eb makedb]# ls -l
total 81
-rwxrwxrwx 1 1000 ftp 3381 Mar 14 09:03 admaster.sql
-rwxrwxrwx 1 1000 ftp 1675 Mar 29 03:02 ebisdata.sql
-rwxrwxrwx 1 1000 ftp 51278 Mar 29 02:16 ebis.sql
-rwxrwxrwx 1 1000 ftp 83 Mar 29 02:18 env_local.conf
-rwxrwxrwx 1 1000 ftp 93 Mar 14 09:03 env_stg.conf
-rwxrwxrwx 1 1000 ftp 7233 Mar 29 03:01 exec.sh
-rwxrwxrwx 1 1000 ftp 5854 Mar 14 09:03 README.md
-rwxrwxrwx 1 1000 ftp 10481 Mar 14 09:03 refdb.sql
drwxrwxrwx 1 1000 ftp 0 Mar 14 09:03 update
[root@6d4f1e2363eb makedb]#
Did I miss something?