From a57b3491058b22f9e9a49e19baf1b60f55911441 Mon Sep 17 00:00:00 2001 From: short <> Date: Mon, 9 Jul 2001 22:42:49 +0000 Subject: [PATCH] System-independent scripts --- bin/fromdos | 2 ++ bin/ftprate | 19 +++++++++++++++++++ bin/m | 9 +++++++++ bin/radary | 7 +++++++ bin/rpmx | 9 +++++++++ bin/sendmailerr | 2 ++ bin/todos | 2 ++ 7 files changed, 50 insertions(+) create mode 100755 bin/fromdos create mode 100755 bin/ftprate create mode 100755 bin/m create mode 100755 bin/radary create mode 100755 bin/rpmx create mode 100755 bin/sendmailerr create mode 100755 bin/todos diff --git a/bin/fromdos b/bin/fromdos new file mode 100755 index 0000000..4daeea6 --- /dev/null +++ b/bin/fromdos @@ -0,0 +1,2 @@ +#! /bin/sh +exec tr -d '\r' diff --git a/bin/ftprate b/bin/ftprate new file mode 100755 index 0000000..c9898e3 --- /dev/null +++ b/bin/ftprate @@ -0,0 +1,19 @@ +#!/bin/sh +if [ $# -lt 1 -o $# -gt 3 ];then + echo "$0: [] []" + exit + fi +if [ -n "$3" ];then + ctms="`date -d "$3" '+%s'`" + ctmd="$3" +else + ctms="`find "$1" -printf "%A@\n"`" + ctmd="`find "$1" -printf "%a\n"`" +fi +find "$1" -printf "scale=2;print \"Current rate: \",%s/(%T@-$ctms),\" B/s\\n\"\n"|bc +if [ -n "$2" ];then + echo -n "Progress : ";find "$1" -printf "scale=2;print \"%`echo -n "$2"|wc -c`s / $2 (\",%s*100/$2,\"%%)\\n\"\n"|bc + echo -n "Start time: ";date -d "$ctmd" + echo -n "Current time: ";date + echo -n "Finish time: ";date --date "`find "$1" -printf "($2-%s)*(%T@-$ctms)/%s\n"|bc` secs" + fi diff --git a/bin/m b/bin/m new file mode 100755 index 0000000..bddbb2c --- /dev/null +++ b/bin/m @@ -0,0 +1,9 @@ +#! /bin/sh +case $# in + 0) ls -lt ~/Mail|less + ;; + 1) exec mutt -f ="$1" + ;; + *) echo "Error parameters" + ;; + esac diff --git a/bin/radary b/bin/radary new file mode 100755 index 0000000..2645f09 --- /dev/null +++ b/bin/radary @@ -0,0 +1,7 @@ +#! /bin/sh +box=$HOME/Mail/radary +while [ -f $box ];do + mv $box $box.$$ + awk '/^From /{hdr=1}{if (!hdr) print}/^$/{hdr=0}' <$box.$$|less + rm -f $box.$$ + done diff --git a/bin/rpmx b/bin/rpmx new file mode 100755 index 0000000..576de87 --- /dev/null +++ b/bin/rpmx @@ -0,0 +1,9 @@ +#! /bin/sh +if [ $# = 0 ];then + echo 'Syntax: $0 ' + exit 1 + fi +while [ $# -gt 0 ];do + rpm2cpio "$1"|cpio -id --quiet #-v #FIXME: --sparse doesn't work, why? + shift + done diff --git a/bin/sendmailerr b/bin/sendmailerr new file mode 100755 index 0000000..a195655 --- /dev/null +++ b/bin/sendmailerr @@ -0,0 +1,2 @@ +#! /bin/sh +exec /usr/sbin/sendmail -fshort+err@vellum.cz "$@" diff --git a/bin/todos b/bin/todos new file mode 100755 index 0000000..87a27bb --- /dev/null +++ b/bin/todos @@ -0,0 +1,2 @@ +#! /bin/sh +exec sed 's/$/ /g' -- 1.8.3.1