Fix -wsBug(72)
This commit is contained in:
parent
f1f0a73ffa
commit
7670e463c7
1 changed files with 18 additions and 2 deletions
|
@ -5,11 +5,27 @@ Released under the "All rights reserved" category. See the RIGHTS.txt file
|
||||||
in /docs/github/ for its full text.
|
in /docs/github/ for its full text.
|
||||||
info
|
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 [ -f $DEFAULT_PATH/$notename ]; then
|
||||||
|
|
||||||
if grep -vq $regex $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
|
else
|
||||||
echo "Pattern matches the whole file."
|
echo "Pattern matches the whole file."
|
||||||
|
|
Loading…
Reference in a new issue