Hello i'm making a sh script with parameters. I need that the user insert 1 parameter and use this in order to run scrapy istance.
#!/bin/sh
# sh yahooscraper.sh
if [ -z "$1"]
then
echo "ERROR you must enter one arg related to the Yahoo URL DB "
else
if ["$1" = "-h"]
then
echo "msg"
else
echo "Reading from $1 database "
cd yahooquestionscraper/yahooscraper/yahooscraper/spiders
scrapy crawl yahoo -o yahoo-url-file.json -a database_name=$1
fi
fi
This script works in the first case, when user don't choose any parameter and in the second else. But don't work in the if ["$1" = "-h"] condition.
Aucun commentaire:
Enregistrer un commentaire