tcsh - confusion with quoting

I am trying to execute the following in a shell script:

Code:
/usr/local/bin/wget -t 25 -o dwnldlog https://opendata.arcgis.com/datasets/c5caefe76b3c4a519711a8489f6def51_21.csv?where=DATE_REPT>=GETDATE()-44
The tcsh does not like () I can't figure how to quote the braces to make the command acceptable.

Thanks for any help.
 
Try putting the URL in single or double quotes:
/usr/local/bin/wget -t 25 -o dwnldlog "https://opendata.arcgis.com/datasets/c5caefe76b3c4a519711a8489f6def51_21.csv?where=DATE_REPT>=GETDATE()-44"
 
tcsh is kinda painful to script with, especially for command redirection...

why don't you just write your scipt in sh? I use tcsh as an interactive shell, and i sometimes write stuff in tcsh for fun, because i like the syntax, but if it's anything useful, i write in sh, like everyone...

you just add a shebang to your file as such:

Code:
#!/bin/sh -

# This is a comment

var this="is a variable"

if [ condition ] then
statement
fi

# etc...  the man sh(8) is quite detailed, and i recommend you be wary of Internet pages and tutorials
# about sh because they replaced sh by bash in Linux, it's slightly different from sh on FreeBSD, and
# most people talk about Linux's symlink to bash when they write about sh.
 
The " " worked well, as suggested. However, now I am getting: HTTP request sent, awaiting response . . . 500 Internal Server Error
 
Yeah, I get that too...

To download the list of police report for the city of Tucson, AZ, if that's what you wanted to do, you should remove everything after the .csv.
 
Yes, I have successfully downloaded the whole file (167mb) by removing the filter code after the csv.
 
Back
Top