From 036a906d8954a45f2fa26356f105bee452011614 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 8 Jul 2017 08:48:06 -0400 Subject: bashrc: new functions take() and torrent() --- dot/bashrc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'dot/bashrc') diff --git a/dot/bashrc b/dot/bashrc index 6a5c336..66df697 100644 --- a/dot/bashrc +++ b/dot/bashrc @@ -283,6 +283,26 @@ esac pingwait() { while ! ping -c1 "$@"; do - sleep 1; + sleep 1 done } + +take () +{ + local n="$1" r= + while [ "$n" -gt 0 ]; do + read line && r="$r $line" + let --n + done + if [ "$r" ]; then + r=${r# } + echo "$r" + else + false + fi +} + +torrent () +{ + rsync -P "$@" borges:/srv/4T-temp/transmission/torrents/ +} -- cgit v1.2.3