~scripts
40 itemsDownload ./*


..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
battery-monitor
checkit
cleverbot.py
clock
color-gen
colors-hex
compton
dailywall
dmenu
importw
indexer
keep-on
mp3ogg
orage
pipes
pipes.x
rain
randwall
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptssearch
11 months agoDownloadRawClose


#!/bin/bash
#
# Author:      Twily                           2016
# Description: Used for searching through irc logs.
# Usage:       $ ./search 'tag1|tag2' tag3 tag4 ...
#

DIR="."

multi() {
    if [ $# -gt 1 ]; then
        shift
        for var in "$@"; do
            str="$str grep -i $var |"
        done
    fi
    str="$str grep ''"
    eval $str
}
search() {
    find $DIR -type f | xargs grep -iE $1 | multi $@ | sort -r | less
}

search $@

exit 0

Top
twily at openmailbox dot org
©twily.info 2013 - 2017



744 047 visits
... ^ v