I have a python script that takes some inputs as arguments. I bash script I want to provide those inputs. here is the input syntax :
usage: $0 <virtualenv-dir>
<cairo-dir>
<file-path>
[--server <es-server>]
[--port <es-port>]
[--fields <columns to be uploaded. Comma separated list of columns]
[--filter <ES filter to use>]
[--from-time <start time>]
[--to-time <end time>]
[--timestamp-field <name-of-timestamp-column>]
<index-name>
<recipients-separated-by-comma>
<output-file-name>
I want to learn how to assign these inputs to variable in a bash script and pass the variables to python script.
I tried these :
VIRTUAL_ENV=$1
CAIRO=$2
PYTHON_FILE_SCRIPT=$3
INDEX=$4
MAIL_LIST=$5
FILE_OUTPUT=$6
shift
shift
# Activate virtual environment
source $VIRTUAL_ENV/bin/activate
# Set PYTHONPATH
export PYTHONPATH=$UBUNTU
cd $UBUNTU
# a cronjob to collect the data from the device
python $3 $4 $5 $6
VIRTUAL_ENV="$1",cd "$UBUNTU",python "$3" "$4" "$5" "$6"...). When you "tried these", what problem did you encounter?[email protected]is the second address in the list. Since you don't quote the input, there's no way of knowing that[email protected], [email protected] outputfile.txtis supposed to be two email addresses separated by a comma or one email address (ending in a comma) followed by an outputfile named[email protected].