How to do something like this correctly?

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

also tried

$: firefox < "lshw -html > /tmp/specs.html"
  • 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; } ....... – Mostafa Esmail Apr 21 '19 at 22:05
  • @SebastianStark data uri not working anymore, get blocking from top level navigation, due security bug – LeonidMew Apr 22 '19 at 7:04

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

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


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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.