summaryrefslogtreecommitdiff
path: root/nocompile/bin
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-04-23 04:53:35 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-04-23 04:53:35 -0500
commita36652959e52e8c810b7d2d76a283b2ae9718d96 (patch)
treea8c9712f7eb243d72bfdb492c0c14e630e78a03d /nocompile/bin
parent318b3220d191011bb9132efd4dbd5e6fb467b4e7 (diff)
downloadmisc-a36652959e52e8c810b7d2d76a283b2ae9718d96.tar.gz
misc-a36652959e52e8c810b7d2d76a283b2ae9718d96.zip
elapsedtime handles partial seconds better
unescape now handles multiple lines from stdin clump can now have an optional argument to specify input separator cuturl can now take compressed short options. (like: cuturl -dPs) filemon... I don't remember. just reformatted it looks like. ipconvert. looks like I added explainations before output. normalpath now uses getenv("PWD") instead of getcwd() so you can pick what you want to be the base for relative paths. urcdump... nothing I guess. probably a space or something dumb. httpd... more environment variables set for CGIs
Diffstat (limited to 'nocompile/bin')
-rwxr-xr-xnocompile/bin/elapsedtime15
-rwxr-xr-xnocompile/bin/unescape6
2 files changed, 15 insertions, 6 deletions
diff --git a/nocompile/bin/elapsedtime b/nocompile/bin/elapsedtime
index 3d26597..ff7ea52 100755
--- a/nocompile/bin/elapsedtime
+++ b/nocompile/bin/elapsedtime
@@ -5,14 +5,21 @@ else
read time
fi
-partials=$(echo $time | cut -d. -f2)
+partials=$(echo $time | grep "\." | cut -d. -f2)
wholes=$(echo $time | cut -d. -f1)
seconds=$(( wholes % 60 ))
minutes=$(( wholes/60 % 60 ))
hours=$(( wholes/60/60 % 24 ))
-days=$(( wholes/60/60/24 % 7 ))
-weeks=$(( wholes/60/60/24/7 ))
-echo $weeks weeks $days days $hours:$minutes:$seconds.$partials
+days=$(( wholes/60/60/24 ))
+#days=$(( wholes/60/60/24 % 7 ))
+#weeks=$(( wholes/60/60/24/7 ))
+#echo $weeks weeks $days days $hours:$minutes:$seconds.$partials
+echo -n $days days $hours:$minutes:$seconds
+if [ "_$partials" != "_" ];then
+ echo .$partials
+else
+ echo
+fi
if read time;then
elapsedtime $time
fi
diff --git a/nocompile/bin/unescape b/nocompile/bin/unescape
index c3cac84..c4560e4 100755
--- a/nocompile/bin/unescape
+++ b/nocompile/bin/unescape
@@ -1,7 +1,9 @@
#!/bin/sh
if [ "_$1" != "_" ];then
l="$1"
+ printf "$(echo "$l" | sed "s/%/\\\\x/g")\n"
else
- read l
+ while read -r l;do
+ printf "$(echo "$l" | sed "s/%/\\\\x/g")\n"
+ done
fi
-printf "$(echo "$l" | sed "s/%/\\\\x/g")"