open-menu closeme
Home
RetroComp icon
Retro Computing Articles Composition Notebooks 8bit
DevOps icon
Automation K8s Done Right
GenAI icon
Fatlama Newsletter Generative AI
SQLite
Status
Links icon
LinkedIn
About
🌐
English Italiano
github linkedin rss

Bash TCP conection feature

calendar Jan 7, 2021 · 1 min read
 featured unix-featured  · bash unix
 ·
Share on: twitter facebook linkedin copy

Bash support tcp connection out of the box :)

 

So you can write something like

#!/bin/bash
webhost="gioorgi.com"
exec 5<>/dev/tcp/$webhost/80
echo -e "GET / HTTP/1.1\\r\\nHost: $webhost\\r\\nContent-Length: 0\\r\\n\\r" >&5
# get reply:   HTTP/1.1 301 Moved Permanently^M
cat <&5

 


Giovanni Giorgi

Master Solution Architect, father and free spirit.
Read More

Recent Posts

  • KarmaKit and Watchtower
  • FatLama for GenAI: The comeback!
  • Caciaball Extreamer
  • Screen to Gif and Terminal Screencam

Latest comments

    Disclaimer

    Gioorgi is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for website owners to earn advertising fees by advertising and linking to amazon.com, audible.com, and any other website that may be affiliated with Amazon Service LLC Associates Program. As an Amazon Associate we earn from qualifying purchases.
    Last updated:2025-05-11 02:00
    Giovanni Giorgi

    Copyright 1999-  GIOVANNI GIORGI. All Rights Reserved

    to-top