From 020f599624b1343d0fe270e027f74232fe253134 Mon Sep 17 00:00:00 2001 From: Patrick Durand Date: Fri, 26 Feb 2016 15:02:54 +0100 Subject: [PATCH] add silent mode option to curl/wget --- scripts/simple_test.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/simple_test.sh b/scripts/simple_test.sh index 846940c..fd517d1 100755 --- a/scripts/simple_test.sh +++ b/scripts/simple_test.sh @@ -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 @@ -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 *** " @@ -64,6 +74,6 @@ fi ################################################################################ # clean up ################################################################################ -#rm -f SRR387476.* +rm -f SRR387476.* exit $RETVAL \ No newline at end of file