There is one URL which will download the csv file, I have to use it in Unix shell script using 'curl' command. Because the already existing script was using the same script, Since the URL has been changed now but its not working with the new URL. This URL should download the csv file & store in the xyz.csv filename. Command already used in existing script, which is connecting to Proxy server using ssh & then removing the already existing file & store the content from the url in the same file :
ssh ${PROXY_SERVER} "rm -f ${SHARED_DATE_FILE} && /usr/bin/curl --silent https://example.com/files/${URL_DATE}.txt > $SHARED_DATE_FILE"
I am trying the below command
ssh ${PROXY_SERVER} "rm -f ${SHARED_DATE_FILE} && /usr/bin/curl --silent https://example-123.com/dts/inrs?format=csv > $SHARED_DATE_FILE"
I can't mention the actual URL here but the URL I have is actually downloading the file in csv format. but its not working through script. it says curl not found. Am I doing something wrong here?
I suspect it's the ? character, which is special for filename expansions. Try quoting the url:
ssh ${PROXY_SERVER} "\
rm -f ${SHARED_DATE_FILE} && \
/usr/bin/curl --silent 'https://example-123.com/dts/inrs?format=csv' > $SHARED_DATE_FILE"