I am trying to log my curl output which looks as following: (which are randomly produced every 10th sec)
<RTW>
<RESULT>{ "Result": { "something1": 707, "something2": { "array": ["95", "51", "65", "33", "95", "109", "87", "37", "49", "86"] } } }</RESULT>
<DISTRICT>{"0000":"City"}</DISTRICT>
</RTW>
My command is as following sh /path/to/script.sh 2>&1 | tee /path/to/logfile.txt
The issue is that I am not logging the original output I am logging some download statistics (which also shows up in the running terminal window). The following things are tracked in the download statistics:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 249 0 204 100 45 125 27 0:00:01 0:00:01 --:--:-- 125
100 249 0 204 100 45 77 17 0:00:02 0:00:02 --:--:-- 77
and so on..
How can I log (what I believe is the stdout) from the curl? I have tried changing the number in the 2>&1
section etc.
My curl command inside the script is as following:
curl -k --data "objectID=ID&username=username&password=passwd" url -H "Header"
-o file.txt
. You should also consider reading the manual. – Sato Katsura Nov 9 '16 at 16:38