Q:

How to check system argument in shell script?

I am trying to run python script by shell script. For running python script I am sending one argument. So I am passing that argument into shell script. But If argument is not pass then is should say Please insert argument and if argument is pass then python script should be start.
Example:
python script - new.py
shell script - new.sh
system argument - 'EUREKA'
run_command - bash new.sh 'EUREKA'

I am trying this shell script to run the process:
if ["$1"]
then 
    python /medaff/Scripts/python/iMedical_Consumption_load_Procs.py "$1"
else
    echo "Please insert application_name"

fi

It is always going in else part. Can you please correct me?

A:

You could check if the length of the string contained in $1 is nonzero. Try:
if [ -n "$1" ]
then 
    python /medaff/Scripts/python/iMedical_Consumption_load_Procs.py "$1"
else
    echo "Please insert application_name"

fi

Or better:
appname="$1"
while [ -z "$appname" ] 
do 
    read -p "Please insert application_name: " appname
done

python /medaff/Scripts/python/iMedical_Consumption_load_Procs.py "$appname"

