diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-07-18 19:39:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-07-18 19:39:04 +0200 |
commit | b5868da56c55ff0ce051b328f45470c8b0653ca4 (patch) | |
tree | d5f64922ae4f7c085fd878d793609ae24db540c2 /ponysay | |
parent | 494dbd1eb5a2ab9ebaa323d34061722fee3986af (diff) | |
download | ponysay-b5868da56c55ff0ce051b328f45470c8b0653ca4.tar.gz ponysay-b5868da56c55ff0ce051b328f45470c8b0653ca4.tar.bz2 ponysay-b5868da56c55ff0ce051b328f45470c8b0653ca4.zip |
flewless `ponysay -l`
Diffstat (limited to 'ponysay')
-rwxr-xr-x | ponysay | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -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 } |