From ce3fac588fb84a109244b9c3d60aba4fc247a86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Sat, 18 Aug 2012 15:15:57 +0200 Subject: [PATCH] adding .sh to shell version + removing old files --- list.pl | 41 ----------------------------------------- ponysay => ponysay.sh | 0 pq4ps-list.pl | 24 ------------------------ pq4ps.pl | 26 -------------------------- 4 files changed, 91 deletions(-) delete mode 100755 list.pl rename ponysay => ponysay.sh (100%) delete mode 100755 pq4ps-list.pl delete mode 100755 pq4ps.pl diff --git a/list.pl b/list.pl deleted file mode 100755 index 20044846..00000000 --- a/list.pl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env perl - -# ponysaylist -# Prints a list of ponies in columns -# -# Licensed under WTFPL -# See COPYING for details - -# Author: Mattias Andrée, maandree@kth.se -# spider-mario - - -use strict; -use warnings; -use utf8; -use feature qw(say); -use integer; -use List::Util qw(max); - -my $scrw = shift @ARGV // 1; - -#for (@ARGV) { -# # Format names from pony names -# s/(?<=[a-z])(?=[A-Z])/ /; -# s/_(.*)/\t($1)/; -#} - -my $maxw = max 1, map {length} @ARGV; - -my $cols = max 1, (($scrw + 2) / ($maxw + 2)); - -my @list = map {sprintf "%-${maxw}s", $_} @ARGV; - -my $rows = (@list + $cols - 1) / $cols; - -my @rowlist; -for my $i (0 .. $#list) { - push @{$rowlist[$i % $rows]}, $list[$i]; -} - -say join ' ', @$_ for @rowlist; diff --git a/ponysay b/ponysay.sh similarity index 100% rename from ponysay rename to ponysay.sh diff --git a/pq4ps-list.pl b/pq4ps-list.pl deleted file mode 100755 index d4517c50..00000000 --- a/pq4ps-list.pl +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl - -print "(sed"; - -foreach $arg (@ARGV) -{ - print " -e 's/ $arg / \e[1m$arg\e[21m /g'"; - print " -e 's/ $arg)/ \e[1m$arg\e[21m)/g'"; - print " -e 's/($arg /(\e[1m$arg\e[21m /g'"; - print " -e 's/($arg)/(\e[1m$arg\e[21m)/g'"; - print " -e 's/ $arg\$/ \e[1m$arg\e[21m/g'"; - print " -e 's/^$arg /\e[1m$arg\e[21m /g'"; - print " -e 's/^$arg\$/\e[1m$arg\e[21m/g'"; -} - -print " | sed"; - -foreach $arg (@ARGV) -{ - print " -e 's/ $arg)/ \e[1m$arg\e[21m)/g'"; - print " -e 's/ $arg\$/ \e[1m$arg\e[21m/g'" -} - -print ")"; diff --git a/pq4ps.pl b/pq4ps.pl deleted file mode 100755 index 2f45053a..00000000 --- a/pq4ps.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/perl - -opendir(DIR, $ARGV[0]."/share/ponysay/ponies/"); -@files = readdir(DIR); - -opendir(DIR, $ARGV[0]."/share/ponysay/quotes/"); -@quotes = readdir(DIR); - - -foreach $file (@files) -{ - $_ = $file; - $_ =~ s/\.pony$//g; - $f = $_; - if (! /^\./) - { foreach $quote (@quotes) - { - $_ = $quote; - $_ =~ s/\.\d+//g; - $_ = '+'.$_.'+'; - if (! /^\./) - { if (/\+$f\+/) - { print $f."@".$quote."\n"; - } } - } } -}