I get a page with wget in a shell script, but the header information is collected in stdout, how can I redirect it to a file?
#!/bin/sh wget -q --server-response http://192.168.1.130/a.php > /tmp/ilan_detay.out root@abc ./get.sh HTTP/1.0 200 OK X-Proxy: 130 Set-Cookie: language=en; path=/; domain=.abc.com X-Generate-Time: 0,040604114532471 Content-type: text/html Connection: close Date: Mon, 17 Jan 2011 02:55:11 GMT root@abc
The header information should be stderr , so you need to redirect this to a file. To do this, change the value > to 2>
stderr
>
2>
To get only the server response in the file, you can do:
wget -q --server-response http://www.stackoverflow.com >& response.txt
You can learn more about redirecting UNIX output here.
Source: https://habr.com/ru/post/1335785/More articles:How do I get the value contained in a specific field of a custom Drupal 7 node? - apiHow can I transfer the doctrine database to Symfony when the project is offline - phpA quick way to find the difference between two strings of equal length in Perl - stringThreadsafe way to expose keySet () - javaCreating a user registration page using MongoEngine - authenticationRead the time series table using read.zoo - rDigital file jar file - javaAsp.net Membership Provider Receives UserName from UserId - asp.netSyntax Highlighting themes for Monodevelop - themesjQuery - select elements that are not included in the identifier - jqueryAll Articles