Reputation: 395
I use shell scripts to call a restful API with wget. However, it works only for the first time, and in the 2nd time, it throws an error---wget: can't open : File exists
The restful API is supposed not to return any value but just insert some records to db on server.
How to fix this?
while read line; do wget http://resturl done
Upvotes: 0
Views: 9571
Reputation: 21
Because there is already a downloaded file exists in your working directory, that's why it works for the first time for you.
Upvotes: 2