Clickable Hyperlink in Linux Terminal


Question [Clickable Hyperlink in Linux Terminal] has 1 solution 2020-08-19 04:26:17 linux

How to echo/print a URL that we can click and open from web browser by using shell script and runs on Linux terminal.


Question [Clickable Hyperlink in Linux Terminal] solution number 1

You mean something like that?

#!/bin/bash
BROWSER=chromium
LINK="https://stackoverflow.com"
TMPFILE="$(mktemp).html"

cat <<EOT >"$TMPFILE"
<!doctype html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>Title</title>
    </head>
    <body>
    <a href="$LINK">click here!</a>
    </body>
</html>
EOT

"$BROWSER" "$TMPFILE"
rm "$TMPFILE"

.htaccess .net .net-core 2d 3d 3d-printing abp abstract-syntax-tree actions-on-google actionscript-3 activemq acumatica adobe-xd aframe ag-grid air airflow ajax akka alert alexa algorithm alignment allure amadeus amazon-cognito amazon-deequ amazon-dynamodb amazon-ec2 amazon-ecs