5 ms·
Wow, this is amazing! Now we could create a /dev/dom virtual device, and write dynamic web pages in pure bash. I love this.
by mahoro 5y ago
Wow, this is amazing!
Now we could create a /dev/dom virtual device, and write dynamic web pages in pure bash. I love this.
- deleted 5y ago[deleted]
- colejohnson66 5y agoOr a DOMFS in /dom that's organized in the same hierarchy as the browser DOM. For example, to write a whole page: 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...
- eurasiantiger 5y agoOracle Acquisitions team would like to discuss a business transaction.
- antocv 5y agoThis comment is worse and more horrible than the parent.
- asplake 5y agoXPath? What's wrong with the find command?
- colejohnson66 5y agoThe way I envisioned it was that attributes are also files themselves, and the contents contain the values. So: // 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”?