Skip to content

Commit 7975a55

Browse files
committed
update
1 parent 8dc345a commit 7975a55

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.bash_aliases

+4
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ export GIT_GLB=${GIT_FRD}/glb
2828

2929
export DISPLAY=:0
3030

31+
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
32+
GIT_PROMPT_ONLY_IN_REPO=1
33+
source $HOME/.bash-git-prompt/gitprompt.sh
34+
fi

libpath.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Check if folder is provided
4+
if [[ $# -ne 1 ]] || [[ ! -d "$1" ]]; then
5+
echo "Usage: $0 <folder>"
6+
exit 1
7+
fi
8+
9+
FOLDER="$1"
10+
declare -A unique_paths
11+
12+
# Use 'find' to get all executable files in the folder
13+
while IFS= read -r -d $'\0' file; do
14+
15+
echo "******** Processing $file"
16+
17+
# Run 'ldd' on the current file, extract shared object paths
18+
# and add them to the associative array.
19+
while IFS= read -r line; do
20+
21+
# Extract paths from ldd output using awk
22+
path=$(echo "$line" | awk -F' => ' '{print $2}' | awk '{print $1}')
23+
24+
if [[ -n "$path" && ! -e "${unique_paths[$path]}" ]] ; then
25+
unique_paths["$path"]=1
26+
fi
27+
28+
done < <(ldd "$file")
29+
30+
done < <(find "$FOLDER" -type f -executable -print0)
31+
32+
# Print unique paths
33+
for path in "${!unique_paths[@]}"; do
34+
echo "$path"
35+
done
36+

0 commit comments

Comments
 (0)