Fix -wsBug(72)
This commit is contained in:
parent
f1f0a73ffa
commit
7670e463c7
1 changed files with 18 additions and 2 deletions
|
@ -5,12 +5,28 @@ Released under the "All rights reserved" category. See the RIGHTS.txt file
|
|||
in /docs/github/ for its full text.
|
||||
info
|
||||
|
||||
grepv() {grep -v $regex $DEFAULT_PATH/$notename} #the command run when input is valid
|
||||
|
||||
nomatch() {
|
||||
echo -n "There are no matches.\nView note anyway?(Y/N): " && read view
|
||||
case $view in
|
||||
y | Y | yes | YES | Yes )
|
||||
cat $DEFAULT_PATH/$notename
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
echo "Cancelled."
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [ -f $DEFAULT_PATH/$notename ]; then
|
||||
|
||||
if grep -vq $regex $DEFAULT_PATH/$notename ; then
|
||||
|
||||
grep -v $regex $DEFAULT_PATH/$notename
|
||||
|
||||
test "$(cat $DEFAULT_PATH/$notename)" = "$(grep -v $regex $DEFAULT_PATH/$notename)" && nomatch || grepv && return 0
|
||||
|
||||
else
|
||||
echo "Pattern matches the whole file."
|
||||
return 0
|
||||
|
|
Loading…
Reference in a new issue