-#!/bin/bash
-
-#
-# selector is a simple shell command for selection of strings with a
-# dynamic pattern-matching.
-#
-# Copyright (c) 2009 Francois Fleuret
-# Written by Francois Fleuret <francois.fleuret@idiap.ch>
-#
-# This file is part of selector.
-#
-# selector is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 3 as
-# published by the Free Software Foundation.
-#
-# selector is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with selector. If not, see <http://www.gnu.org/licenses/>.
-#
-
-# You can add in your ~/.inputrc something like
-# Control-h: "smarthist.sh\n"
-# so that C-h will invoke this script
-
-EXE=./selector
-
-# We do not want a security breach
-
-OUT=`mktemp /tmp/selector.XXXXXX`
-touch ${OUT}
-chmod go-rwx ${OUT}
-
-${EXE} -o ${OUT} -f ~/.bash_history
-# ${EXE} -b -o ${OUT} -f ~/.bash_history
-
-# We set the echo off
-
-OLD_SETTINGS=`stty -g`
-stty -echo raw
-
-# Put the line we got into the tty buffer
-
-writevt `tty` "`cat ${OUT}`"
-
-# Set back the echo as it was
-
-stty ${OLD_SETTINGS}
-
-# Remove the file containing what we got from the selector
-
-\rm ${OUT}