I don't have much experiences on bash, and I need to run a python file from my Ubuntu VM terminal. The python file needs some user inputs passed in as arguments, I am wondering if there is any way to let me have customised options that followed by user inputs.
I have tried 'alias options =''' but it is not something that I need here unfortunately.
I'd like to have something like this:
python test.py -name [name] -gender [gender]
Hope someone would help.
-nameand-genderand remove those two option label and pass simplyJoe Mit becomes trivial using the positional parameters$1and$2.function my_python_script() { python test.py -name "$1" -gender "$2"; }. That said if you can modify the python script then I'd go with David C. Rankin's suggestion.functionthere;my_python_script() { ...; }is compatible with all POSIX-compliant shells, whereasfunction my_python_script() { ...; }is only available in those that support a mismash of POSIX and legacy ksh syntax (the latter being justfunction my_python_script {with no()). See wiki.bash-hackers.org/scripting/obsolete