git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/localfs/etc/profile.d/netcatandquit.sh
diff options
context:
space:
mode:
authorHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-11-01 13:30:58 +0100
committerHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-11-01 13:30:58 +0100
commit0632591996893fe136a1f2fe44d9b9f404f41f3e (patch)
tree7340edbe7c212da3db45a83219147143a3268c8d /localfs/etc/profile.d/netcatandquit.sh
downloadfedora-laptop-0632591996893fe136a1f2fe44d9b9f404f41f3e.tar.bz2
Initial commit
Diffstat (limited to 'localfs/etc/profile.d/netcatandquit.sh')
-rw-r--r--localfs/etc/profile.d/netcatandquit.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/localfs/etc/profile.d/netcatandquit.sh b/localfs/etc/profile.d/netcatandquit.sh
new file mode 100644
index 0000000..5410051
--- /dev/null
+++ b/localfs/etc/profile.d/netcatandquit.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Harald Pfeiffer, 2017-04-17
+# Quick helper to have an ncat command available which, similarly to netcat -z,
+# terminates the ncat connection as soon as there's a successful establishment.
+#
+# tl;dr fek incomplete replacements 凸ಠ_ಠ)凸
+
+
+# Let's check whether "echo -e" outputs "echo -e", we then will quit
+# (no escape sequences mean no escape, lel.)
+echo -e "moo"|grep -- "-e moo" >/dev/null 2>&1
+[ "$?" -eq 0 ]&&exit 0
+
+alias ncquit='echo -ne "\e[3;12r\e[3H"|ncat'