diff options
Diffstat (limited to 'nocompile/bin')
-rwxr-xr-x | nocompile/bin/elapsedtime | 15 | ||||
-rwxr-xr-x | nocompile/bin/unescape | 6 |
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")" |