Wow, this is amazing!
Now we could create a /dev/dom virtual device, and write dynamic web pages in pure bash. I love this.
Now we could create a /dev/dom virtual device, and write dynamic web pages in pure bash. I love this.
echo "...." > /dom
Update the <title> tag: echo "TITLE" > /dom/html/head/title
Change the charset: echo "EBCDIC" > /dom/html/head/meta[1].charset // second <meta> tag
echo "EBCDIC" > /dom/html/head/1.charset // second child of <head>
Even go full XPath and replace a tag's inner HTML: echo "<div>abc</div>" > /dom/[@id='myID']
This is a horrible idea... // given:
<div id="myID">
// `id` attribute is located in
/dom/html/body/…/div[n].id
So unless you look at the contents of the files, you wouldn’t be able to find a certain ID. Because of that, DOMFS (when XPath is enabled) would expose that same "file" at `/dom/[@id='myID']` as well.I guess you could do something like this?
grep "myID" /dev/**/*.id
But why would you even use this “DOMFS”?