etc

small bits of code not worth their own repo
git clone git://git.benoneill.xyz/etc
Log | Files | Refs | README | LICENSE

commit a625ac829ec00dba9f15f48d0d31e6aaac33505d
parent af97b93fc5205eba982e5b0cccedba132fd3a11c
Author: Ben O'Neill <ben@benoneill.xyz>
Date:   Sun, 19 Sep 2021 19:30:09 -0400

add some scripts

Diffstat:
Adcalc.sh | 6++++++
Amdview.sh | 5+++++
Aworduse.sh | 5+++++
3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dcalc.sh b/dcalc.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# dcalc: a calculator using dmenu +# usage: dcalc + +eq="$(dmenu -p "calc:" </dev/null)" +[ ! -z "$eq" ] && notify-send "calc" "$(echo "$eq" | bc -l 2>&1 | sed 's/-/\\-/')" diff --git a/mdview.sh b/mdview.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# compile markdown file and view in lynx(1) +# usage: mdview [file] + +smu $1 | lynx -stdin diff --git a/worduse.sh b/worduse.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# worduse: calculate word frequency from standard input +# usage: worduse + +sed 's/--/ /' | tr -cd '[:alpha:] \n' | tr '[:upper:]' '[:lower:]' | awk -v OFS='\n' '{$1=$1}1' | tr -d ' \t' | sort | uniq -c | sort -n