Skip to content

Commit 148b7ae

Browse files
committed
script to find the fucntions into a source code
1 parent b407fd7 commit 148b7ae

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

findFunc.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
#pass three args db with functions, the path of the sorce code and the output path
4+
5+
input=$1 #file with the list of functions
6+
sourceCodePATH=$2 #locate of the source code
7+
output=$3 # output path
8+
9+
echo -e "This is an archive of dangerous programming functions known for causing security vulnerabilities in software\n" >> "$output/results.txt"
10+
while IFS= read -r line
11+
do
12+
echo -e "\n########### $line ###########\n" >> "$output/results.txt"
13+
find "$sourceCodePATH" -type f -exec grep -wnH "$line" {} \; |tee -a "$output/results.txt"
14+
echo -e "\n" >> "$output/$results.txt"
15+
done < "$input"

0 commit comments

Comments
 (0)