# tcsh - confusion with quoting



## dsijams (Jul 14, 2017)

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


```
/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.


----------



## tobik@ (Jul 14, 2017)

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"`


----------



## Minbari (Jul 14, 2017)

Simple quotes should do the job:


```
wget -t 25 -o dwnldlog 'https://...... '
```


----------



## poorandunlucky (Jul 16, 2017)

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:


```
#!/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.
```


----------



## dsijams (Jul 16, 2017)

The " " worked well, as suggested. However, now I am getting: `HTTP request sent, awaiting response . . . 500 Internal Server Error`


----------



## poorandunlucky (Jul 16, 2017)

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.


----------



## dsijams (Jul 16, 2017)

Yes, I have successfully downloaded the whole file (167mb) by removing the filter code after the csv.


----------

