From c19f5837f8ce527ab21aefeb29cc2e14033b4a19 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 15 Apr 2024 11:52:52 +0200 Subject: [PATCH] move cat_stty and echo_stty to ~/nico/bin --- etc/profile.d/functions | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index b11a5bf8..bf3c0e03 100755 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -7,30 +7,6 @@ type -P which > /dev/null || which() { type -P "$1" 2>&1; } -echo_stty() { - usage="echo_stty DEVICE [BAUD=9600]" - local dev="${1?$usage}" - local str="${2?$usage}" - local baud="${3:-9600}" - - (cat "$dev" > /dev/null &) >/dev/null 2>&1 - local pid=$! - - stty "$baud" -F "$dev" raw -echo - echo "$str" > "$dev" - - kill "$pid" >/dev/null 2>&1 - - return 0 -} - -cat_stty() { - usage="cat_stty DEVICE [BAUD=9600]" - local dev="${1?$usage}" - local baud="${2:-9600}" - stty "$baud" -F "$dev" raw -echo && cat "$dev" -} - which nproc > /dev/null || nproc() { case "$OSTYPE" in darwin*) sysctl -n hw.ncpu ;; -- 2.47.3