Last active
September 28, 2015 08:17
-
-
Save rytoj/830989a35bcec74a3daf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#: Title: seach | |
#: Date: 2015-09-29 | |
#: Author: "sup" <[email protected]> | |
#: Version: 1.1 | |
#: Options: None | |
#Tikrina ar ivestas bent vienas argumentas | |
DATA="/bin/kontaktai.txt" | |
clear | |
echo -n "Seach: " | |
while IFS= read -rn1 char;do | |
clear | |
word="$word$char" | |
#Check if Backspace is pressed | |
if [[ $char == $'\177' ]] | |
then | |
word=${word%?} | |
word=${word%?} | |
fi | |
#Check for empty string | |
if [[ -z $word ]];then | |
echo "--" | |
else | |
grep -i --color -m 25 $word $DATA | |
fi | |
echo -n "Seach: " | |
echo -n "$word" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment