瀏覽代碼

added error handling to solr_import.sh script

main
Simon Bowie 2 年之前
父節點
當前提交
2f0120932d
共有 1 個檔案被更改,包括 11 行新增5 行删除
  1. +11
    -5
      solr_import.sh

+ 11
- 5
solr_import.sh 查看文件

# https://www.redhat.com/sysadmin/arguments-options-bash-scripts # https://www.redhat.com/sysadmin/arguments-options-bash-scripts


############################################################ ############################################################
# Subprograms #
# subprograms #
############################################################ ############################################################
License() License()
{ {
} }
############################################################ ############################################################
############################################################ ############################################################
# Main program #
# main program #
############################################################ ############################################################
############################################################ ############################################################


# Set variables
# set variables
directory="/Users/ad7588/projects/patent_site_python" directory="/Users/ad7588/projects/patent_site_python"


# Get the options
# error message for no flags
if (( $# == 0 )); then
Help
exit 1
fi

# get the options
while getopts ":hlimzaespxdw" option; do while getopts ":hlimzaespxdw" option; do
case $option in case $option in
l) # display License l) # display License
Import Import
exit;; exit;;
\?) # Invalid option \?) # Invalid option
echo "Error: Invalid option"
Help
exit;; exit;;
esac esac
done done

Loading…
取消
儲存