use parameter expansion instead of sed

This commit is contained in:
illiliti 2020-02-28 20:57:03 +03:00
parent a5b5814abd
commit ee011f3a20

View File

@ -250,7 +250,7 @@ install_driver() {
while read -r full_driver; do while read -r full_driver; do
# strip uneeded stuff # strip unneeded stuff
full_driver="${full_driver##*builtin*}" full_driver="${full_driver##*builtin*}"
full_driver="${full_driver##*net*}" full_driver="${full_driver##*net*}"
full_driver="${full_driver#insmod }" full_driver="${full_driver#insmod }"
@ -343,9 +343,17 @@ install_binary() {
# exract paths to libraries # exract paths to libraries
ldd "$fullbin" | ldd "$fullbin" |
sed -nr 's,.* (/.*lib.*/.*.so.*) .*,\1,p;s,.*(/lib.*/ld.*.so.*) .*,\1,p' |
while read -r library; do while read -r library; do
# strip unneeded stuff
library="${library##*vdso*}"
library="${library#* => }"
library="${library% *}"
# check empty
[ "$library" ] || continue
install_library "$library" install_library "$library"
done done
} }