Wget in bash


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Wget in bash
# 1  
Old 04-28-2015
Wget in bash

I am attempting to write a bash that starts by using wget and getting the following errors:

Stand-alone code that works:
Code:
 wget -O getCSV.txt http://172.24.xxx.xxx/data/getCSV.csv

Code:
c:\cygwin\home\cmccabe\NGS.sh: line 2: $'\r': command not found
: No such file or directorysh: line 3: cd: C:\Users\cmccabe\Desktop\wget
--2015-04-28 11:32:34--  http://172.24.xxx.xxx/data/getCSV.csv%0D%0D
Connecting to 172.24.xxx.xx:80... connected.
HTTP request sent, awaiting response... 404 NOT FOUND
2015-04-28 11:32:34 ERROR 404: NOT FOUND.

c:\cygwin\home\cmccabe\NGS.sh: line 6: $'\r': command not found
c:\cygwin\home\cmccabe\NGS.sh: line 7: $'{\r': command not found


What is the id of the NGS patient, use a comma between multiple:

I have attached the .sh as well. Thank you Smilie.
# 2  
Old 04-28-2015
i don't use cygwin but I know bash and it's complaining of your line endings. Use an editor that doesn't put \r in your files. you can strip them many ways. the simplest is: tr -d '\r' NGS.sh > newNGS.sh.
This User Gave Thanks to neutronscott For This Post:
# 3  
Old 04-28-2015
Code:
 tr -d '\r' NGS.sh > newNGS.sh
tr: extra operand ‘NGS.sh'
Only one string may be given when deleting without squeezing repeats.
Try 'tr --help' for more information.

I use notepad ++ and forgot to change the EOL to unix. The line endings seemed to be fixed but now this error:

Code:
c:\cygwin\home\cmccabe\NGS.sh: line 4: -O: command not found
http://: Invalid host name.

Thank you Smilie.

---------- Post updated at 12:43 PM ---------- Previous update was at 12:07 PM ----------

I figured it out... thank you Smilie.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

2. Shell Programming and Scripting

Store filenames for wget in bash

I have a bash that downloads a list of files as a text file using wget. What I now need to do is store those files names and pass them to a download call also using wget. List.txt in /home directory FilterDuplicates.html file1.bam file2.bam file3.bam file1.vcf.gz file2.vcf.gz... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Shell Programming and Scripting

Wget and gz

Can wget be used to goto a site and piped into a .gz extrated command? wget ftp://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh37 | gunzip -d clinvar_20150603.vcf.gz (1 Reply)
Discussion started by: cmccabe
1 Replies

4. Shell Programming and Scripting

Wget in bash using sed and awk

In the bash below when the program is opened the download function runs and downloads the getCSV file and on the screen "Downloading getCSV.csv:%" displays and when it completes the menu function is called. However, as of now the bash opens and closes after a few seconds and I'm not sure... (4 Replies)
Discussion started by: cmccabe
4 Replies

5. Shell Programming and Scripting

BASH scripting - Preventing wget messed downloaded files

hello. How can I detect within script, that the downloaded file had not a correct size. linux:~ # wget --limit-rate=20k --ignore-length -O /Software_Downloaded/MULTIMEDIA_ADDON/skype-4.1.0.20-suse.i586.rpm ... (6 Replies)
Discussion started by: jcdole
6 Replies

6. UNIX for Dummies Questions & Answers

Wget

...... (1 Reply)
Discussion started by: hoo
1 Replies

7. Shell Programming and Scripting

wget help?

can someone please help in understanding this shell script? wget --progress=dot:mega --cut-dirs=4 -r -c -nH -np --reject index.html*,icons/*.gif \ http://*****.oz.xxxxx.com:<portnum>/omcsm/releases/dew/${UPGRADE_VERSION}/ (1 Reply)
Discussion started by: dnam9917
1 Replies

8. Shell Programming and Scripting

Help with wget

Hi, i need temperature hourly from a web page Im using wget to get the web page. I would like to save the page downloaded in a file called page. I check the file everytime i run the wget function but its not saving but instead creates a wx.php file....Each time i run it...a new wx.php file is... (2 Replies)
Discussion started by: vadharah
2 Replies

9. Shell Programming and Scripting

How to script wget in bash?

The script below is giving me grief! The error message says /download.bash: line 16: syntax error near unexpected token `else' ./download.bash: line 16: `else wget "http://downloads.sourceforge.net/hibernate/hibernate-3.2.5.ga.zip?modtime=1185893922&big_mirror=1" ' I think it must be a... (1 Reply)
Discussion started by: siegfried
1 Replies

10. Shell Programming and Scripting

wget -r

I have noticed a lot of expensive books appearing online so I have decided to copy them to CD. I was going to write a program in java to do this, but remembered that wget GNU program some of you guys were talking about. Instead of spending two hours or so writing a program to do this.... (1 Reply)
Discussion started by: photon
1 Replies
Login or Register to Ask a Question