From b6ffd43d1755f26994045eb451eb0e41fc24714a Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Thu, 16 Aug 2018 12:28:28 +0300 Subject: [PATCH] Add 'findstr.sh' (misc) --- misc/findstr.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 misc/findstr.sh diff --git a/misc/findstr.sh b/misc/findstr.sh new file mode 100644 index 0000000..afbf1c0 --- /dev/null +++ b/misc/findstr.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +################################################## + +# Find a string in package files (Arch Linux) +# +# Usage: + +# bash ./findstr.sh +# +# For example: +# +# bash ./findstr.sh makepkg E_USER_FUNCTION_FAILED + +################################################## + +for file in $(pacman -Ql $(pacman -Qo $(which "${1}") | awk '{print $($NF)}') | awk '{print $2}' | sed '/\/$/d'); do + grep -ril "{2}" ${file} +done