Last active
October 28, 2020 15:32
-
-
Save akccakcctw/6db2fdebfc009e80bd8304e41aeaf2bc to your computer and use it in GitHub Desktop.
Revisions
-
akccakcctw revised this gist
Oct 28, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ helpFunction() { exit 1 } while getopts "f:o:" opt do case "$opt" in f ) filePath="$OPTARG" ;; -
akccakcctw revised this gist
Oct 28, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ while read -r line; do if ! rg -q "('|\")$line('|\")" < /dev/null; then # not found (exit code !== 0) echo "$line" >> "$outputPath" fi done < "$filePath" echo "done. " -
akccakcctw revised this gist
Oct 28, 2020 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,20 +3,20 @@ set -e helpFunction() { echo "" echo "Usage: $0 -f file_path -o output_path" echo -e "\t-f file path" echo -e "\t-o output path" exit 1 } while getopts "f:o:s:" opt do case "$opt" in f ) filePath="$OPTARG" ;; o ) outputPath="$OPTARG" ;; ? ) helpFunction ;; esac done # start @@ -28,6 +28,6 @@ while read -r line; do then # not found (exit code !== 0) echo "$line" >> "$outputPath" fi done < "$filePath" echo "done. " -
akccakcctw revised this gist
Oct 28, 2020 . 1 changed file with 9 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,8 @@ set -e helpFunction() { echo "" echo "Usage: $0 -f file_path -o output_path" echo -e "\t-f file path" echo -e "\t-o output path" exit 1 } @@ -16,17 +15,19 @@ do case "$opt" in f ) filePath="$OPTARG" ;; o ) outputPath="$OPTARG" ;; ? ) helpFunction ;; esac done # start cnt=0 while read -r line; do cnt=$(( cnt + 1 )) echo -ne "testing $cnt case... \r" if ! rg -q "('|\")$line('|\")" < /dev/null; then # not found (exit code !== 0) echo "$line" >> "$outputPath" fi done < "$filePath" echo "done. " -
akccakcctw created this gist
Oct 28, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #!/usr/bin/env bash set -e helpFunction() { echo "" echo "Usage: $0 -f file_path -s search_path -o output_path" echo -e "\t-f file path" echo -e "\t-s search path" echo -e "\t-o output path" exit 1 } while getopts "f:o:s:" opt do case "$opt" in f ) filePath="$OPTARG" ;; o ) outputPath="$OPTARG" ;; s ) searchPath="$OPTARG" ;; ? ) helpFunction ;; esac done # start while IFS= read -r line; do which rg if rg -q "$line" "$searchPath"; then true else echo "$line" >> "$outputPath" fi done < "$filePath"