It seems whenever I test this on the shell it works but when I'm running it from a script it won't.
Shell:
fips=55555
echo https://www2.census.gov/geo/tiger/TIGER2016/ROADS/tl_2016_$fips'_'roads.zip
>>https://www2.census.gov/geo/tiger/TIGER2016/ROADS/tl_2016_55555_roads.zip
I'm trying to loop through some data in a text file like this:
And parse it/input into a curl url:
But the output has the beginning of the string overwritten like this:
./readFipsData.txt
>>_roads.zipw2.census.gov/geo/tiger/TIGER2016/ROADS/tl_2016_48001
Note: I am using Git Bash for Windows if that makes any difference.
cat ./testFipsData.txt |
while read line
do
counter=0
for col in $line
do
if [ $counter == 0 ]
then
state=$col
elif [ $counter == 1 ]
then
county=$col
elif [ $counter == 2 ]
then
fips=$col
fi
((counter++))
done
#curl -k -o ./$county.zip "https://www2.census.gov/geo/tiger/TIGER2016/ROADS/tl_2016_$fips_roads.zip"
echo https://www2.census.gov/geo/tiger/TIGER2016/ROADS/tl_2016_$fips'_'roads.zip
done