It is necessary to receive from curl the answer to the file + time. Now it works like this:
$ curl example.com > file It is necessary that the time when the answer was added to the response line.
Something like:
1234567 16:30:13 How to do it?
update : replaced > with >> , in view of the additional requirement that appeared: add information to the file , and not overwrite it each time.
for example:
$ { curl example.com | tr -d '\n'; date +' %T'; } >> file tr -d '\n' will remove the line break from the curl output (if any).
-s - if the curl program curl something, it will be sent to stderr , i.e. it will not get into your file . - aleksandr barakin> replace with >> . - aleksandr barakin 1:56 pmSource: https://ru.stackoverflow.com/questions/445582/
All Articles