Path: blob/devel/elmerice/IceSheet/Greenland/DATA/scripts/GET_FROM_NSIDC.sh
5319 views
#!/bin/bash12## get data from nsidc3if [ $# -eq 0 ]4then5echo "No arguments supplied -- ABORT --"6echo7echo "provide the url of the file to download"8fi9## test if authentication file exist10if [ ! -e "$HOME/.netrc" ]; then11echo "~/.netrc does not exist"12echo13echo "see https://wiki.earthdata.nasa.gov/display/EL/How+To+Access+Data+With+cURL+And+Wget"14echo15echo " echo "machine urs.earthdata.nasa.gov login \<uid\> password \<password\>" >> ~/.netrc"16echo " chmod 0600 ~/.netrc"17echo18echo "or directly download file from you web browser from this link:"19echo $120echo21exit 122fi23# create cookies file24if [ ! -f "~/.urs_cookies" ]; then25touch ~/.urs_cookies26fi27## download file using curl28curl -O -b ~/.urs_cookies -c ~/.urs_cookies -L -n $12930313233