2

How to do something like this correctly?

$: lshw -html > /tmp/specs.html < firefox

also tried

$: firefox < "lshw -html > /tmp/specs.html"
2
  • thanks , it worked . But the html appeared like as a source like this ?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="w3.org/1999/xhtml"> <head> <meta name="generator" content="lshw-B.02.18" /> <style type="text/css"> .first {font-weight: bold; margin-left: none; padding-right: 1em;vertical-align: top; } ....... Apr 21, 2019 at 22:05
  • @SebastianStark data uri not working anymore, get blocking from top level navigation, due security bug
    – LeonidMew
    Apr 22, 2019 at 7:04

1 Answer 1

6

You should output lshw to a file, and open that file with firefox, as follows:

lshw -html >/tmp/specs.html && firefox /tmp/specs.html

Or

sudo lshw -html >/tmp/specs.html && firefox /tmp/specs.html

Update: Following not uses temp files, but need bcat
Install bcat package:

sudo apt install ruby-bcat

Then the command you want is simple

lshw -html|bcat -b firefox

bcat help output:

Pipe to browser utility. Read standard input, possibly one or more s, and write concatenated / formatted output to browser.

8
  • thanks for the answer , but I don't want to write the filename again Apr 21, 2019 at 21:16
  • I mean , I want to use the output file "specs.html" as an input for the command firefox Apr 21, 2019 at 21:26
  • Would using a variable solve your issue? e.g. FILE="/tmp/specs.html"; lshw -html > $FILE && firefox $FILE. Apr 21, 2019 at 22:34
  • thanks , but this is the same ,, you wrote $FILE twice Apr 21, 2019 at 23:28
  • 1
    @MostafaEsmail Updated answer. With bcat you don't need to write to file at all
    – LeonidMew
    Apr 22, 2019 at 7:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .