从命令提示符创建 Hello World,然后在 Firefox 中显示结果

tou*_*not 3 command-line firefox prompt

我想通过命令行制作简单快速的程序,然后在 Firefox 中显示结果...

我发现 Hello World 是学习它的最简单方法:)

我该怎么做?

A.B*_*.B. 5

作为单线?;)

echo '<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>Hello World</body></html>' > index.html && xdg-open index.html
Run Code Online (Sandbox Code Playgroud)

awk 也是命令行,因此

awk '//' <<<'<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body>Hello World</body></html>' > ~/tmp/index.html && xdg-open ~/tmp/index.html
Run Code Online (Sandbox Code Playgroud)

可怕,但也有可能

echo "Hello World" > index.html && xdg-open index.html
Run Code Online (Sandbox Code Playgroud)