Can I get the file modification time and size remotely without downloading the file?
I know that maybe I can use curl to get ithave a Linux VPS, but I don't know how to use shell script to get it in batches and writeThere are many HTML forms on it to the corresponding line of the file.
This is the source data text, which is an html file with the following contentsas follows:
<table>
<thead>
<tr>
<th>ver</th>
<th>link</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.0.1</td>
<td><a href="http://speedtest.tokyo2.linode.com/100MB-tokyo2.bin">download</a></td>
</tr>
<tr>
<td>1.0.2</td>
<td><a href="http://speedtest.singapore.linode.com/100MB-singapore.bin">download</a></td>
</tr>
<tr>
<td>1.0.3</td>
<td><a href="http://speedtest.fremont.linode.com/100MB-fremont.bin">download</a></td>
</tr>
<tr>
<td>1.0.4</td>
<td><a href="http://speedtest.dallas.linode.com/100MB-dallas.bin">download</a></td>
</tr>
<tr>
<td>1.0.5</td>
<td><a href="http://speedtest.atlanta.linode.com/100MB-atlanta.bin">download</a></td>
</tr>
<tr>
<td>1.0.6</td>
<td><a href="http://speedtest.newark.linode.com/100MB-newark.bin">download</a></td>
</tr>
<tr>
<td>1.0.7</td>
<td><a href="http://speedtest.london.linode.com/100MB-london.bin">download</a></td>
</tr>
<tr>
<td>1.0.8</td>
<td><a href="http://speedtest.frankfurt.linode.com/100MB-frankfurt.bin">download</a></td>
</tr>
<tr>
<td>1.0.9</td>
<td><a href="http://speedtest.tokyo2.linode.com/100MB-tokyo2.bin">download</a></td>
</tr>
<tr>
<td>1.0.10</td>
<td><a href="http://speedtest.singapore.linode.com/100MB-singapore.bin">download</a></td>
</tr>
</tbody>
</table>
The table is relatively simple, only the version number and file download link.
I want to use a shell script to access the URL in the table, in order to get the remote file modification timedate and size, and then write toupdate this information into the table, similar to the picture below.
They will eventually look like this:
Before asking the question, I looked at the curl and wget documentation, where the curl test can view the file information in standard output, but I don't know how to write an automated script to accomplish this task. I just got in touch with Linux, hope can get everyone's help, thank in advanceyou!
