From b5868da56c55ff0ce051b328f45470c8b0653ca4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 18 Jul 2012 19:39:04 +0200 Subject: flewless `ponysay -l` --- ponysay | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index a5edea0..0928737 100755 --- a/ponysay +++ b/ponysay @@ -20,28 +20,15 @@ version() { list() { scrw=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2` - (( $scrw > 80 )) && scrw=80 + + listcmd=$(echo $0 | sed -e 's/\/ponysay$/\//g' -e 's/\/ponythink$/\//g')"ponysaylist.pl" echo -e "\\e[01mponyfiles located in $SYSTEMPONIES:\\e[21m" - files=`ls -1 $SYSTEMPONIES | sed "s/.pony//"` - maxw=1 - for file in $files; do - w=$(( `echo $file | wc -m` + 2 )) - (( $maxw < $w )) && maxw=$w - done - cols=$(( $scrw / $maxw )) - echo "$files" | pr -T --columns=$cols + perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed "s/.pony//" | sort) if [[ -d $HOMEPONIES ]]; then echo -e "\\e[01mponyfiles located in $HOMEPONIES:\\e[21m" - files=`ls -1 $HOMEPONIES | sed "s/.pony//"` - maxw=1 - for file in $files; do - w=$(( `echo $file | wc -m` )) - (( $maxw < $w )) && maxw=$w - done - cols=$(( $scrw / $maxw )) - echo "$files" | pr -T --columns=$cols + perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed "s/.pony//" | sort) fi } -- cgit