This method comes in helping those who need to text or HTML content.
In fact, a combination of Linux commands to get an output.
Suppose we have a list of jpeg files in folder image.
They should exist into HTML to be displayed.
As we know an image has the form:
<img src="image/name_of_jpeg.jpg" alt="" /> 11.jpg,12.jpg,13.jpg,14.jpg,15.jpgFirst, I will display files:
$ ll | awk '/jpg/ {print $9}'
11.jpg
12.jpg
13.jpg
14.jpg
15.jpg In these variables put the beginning of each line:
f1=‘<img src="image‘; First, remove the space before the file name.
The second will add the rest to complete the link.
The xargs command is used with echo and print the first part of the link.
Finally we use <<< aaaa.html to output the HTML file.
The full script is here .
 
