Fix -wsBug(72)

This commit is contained in:
dmarakom6 2021-06-30 19:07:37 +03:00
parent f1f0a73ffa
commit 7670e463c7

View file

@ -5,12 +5,28 @@ 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."
return 0 return 0