Ask user to show lines (cl)
This commit is contained in:
parent
23f9a6f6e4
commit
c453b82bc3
1 changed files with 21 additions and 7 deletions
|
@ -5,12 +5,26 @@ Released under the "All rights reserved" category. See the RIGHTS.txt file
|
|||
in /docs/github/ for its full text.
|
||||
info
|
||||
|
||||
out="$(grep $regex $DEFAULT_PATH/$notename | wc -l)"
|
||||
if [ -f $DEFAULT_PATH/$notename ]; then
|
||||
|
||||
out="$(grep $regex $DEFAULT_PATH/$notename | wc -l)"
|
||||
|
||||
if [ $out -eq 1 ]; then
|
||||
echo "Compressed $out line of grep output."
|
||||
elif [ $out -gt 1 ]; then
|
||||
echo "Compressed $out lines of grep output."
|
||||
echo -n "Show lines?(Y/N): " && read show
|
||||
case $show in
|
||||
yes | y | Y | YES | Yes )
|
||||
grep -n $regex $DEFAULT_PATH/$notename
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "No matching lines found."
|
||||
fi
|
||||
|
||||
if [ $out -eq 1 ]; then
|
||||
echo "Compressed $out line of grep output."
|
||||
elif [ $out -gt 1 ]; then
|
||||
echo "Compressed $out lines of grep output."
|
||||
else
|
||||
echo "No matching files found."
|
||||
fi
|
||||
echo "No such file."
|
||||
return 0
|
||||
|
||||
fi
|
Loading…
Reference in a new issue