bnetkit

simple networking utilities
git clone git://bvnf.space/bnetkit.git
Log | Files | Refs

gopher (227B)


      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
#!/bin/sh -e

[ "$#" -lt 1 ] && {
    printf "usage: %s [gopher://]example.com/foo/bar\n" "$0" >&2
    exit 1
}


nopref="${1##gopher://}"
host="${nopref%%/*}"
path="${nopref#"$host"}"
printf "%s\r\n" "$path" | ./nc "$host" 70