Skip to content

Commit

Permalink
add silent mode option to curl/wget
Browse files Browse the repository at this point in the history
  • Loading branch information
genscale-admin committed Feb 26, 2016
1 parent ad19f89 commit 020f599
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions scripts/simple_test.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
#!/bin/bash

# One can define SILENT_MODE=true to enable progrss monitor while loading data
# from EBI.

################################################################################
# we download a sample bank from EBI
################################################################################
# if wget is not installed, you may use "curl -O ..."
rm -f SRR387476.*
DATA_SAMPLE="ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR387/SRR387476/SRR387476.fastq.gz"
WGET_PATH=`which wget`
echo ">>> Retrieving data sample: ${DATA_SAMPLE}"
if [ ! -z "$WGET_PATH" ] ; then
echo " using '$WGET_PATH'..."
#wget --quiet: to discard progress monitor
wget ${DATA_SAMPLE}
if [ $SILENT_MODE="true" ] ; then
wget --quiet ${DATA_SAMPLE}
else
wget ${DATA_SAMPLE}
fi
else
CURL_PATH=`which curl`
if [ ! -z "$CURL_PATH" ] ; then
echo " using '$CURL_PATH'..."
#curl --silent: to discard progress monitor
curl -O ${DATA_SAMPLE}
if [ $SILENT_MODE="true" ] ; then
curl --silent -O ${DATA_SAMPLE}
else
curl -O ${DATA_SAMPLE}
fi
else
echo " /!\ error: unable to find 'wget' or 'curl'"
exit 1
Expand Down Expand Up @@ -51,7 +61,7 @@ ${LEON_CMD} -d -file SRR387476.fastq.leon
# we check the result
################################################################################

echo ">>> step 2/3: comparing original file and leon processed one..."
echo ">>> step 3/3: comparing original file and leon processed one..."
diff ./SRR387476.fastq ./SRR387476.fastq.d
if [ $? -eq 0 ]; then
echo "*** test OK *** "
Expand All @@ -64,6 +74,6 @@ fi
################################################################################
# clean up
################################################################################
#rm -f SRR387476.*
rm -f SRR387476.*

exit $RETVAL

0 comments on commit 020f599

Please sign in to comment.