From a36652959e52e8c810b7d2d76a283b2ae9718d96 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Thu, 23 Apr 2015 04:53:35 -0500 Subject: 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 --- nocompile/bin/elapsedtime | 15 +++++++++++---- nocompile/bin/unescape | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'nocompile/bin') 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")" -- cgit v1.2.3