Browse Source

Add 'findstr.sh' (misc)

master
Pekka Helenius 5 years ago
committed by GitHub
parent
commit
b6ffd43d17
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      misc/findstr.sh

+ 19
- 0
misc/findstr.sh View File

@ -0,0 +1,19 @@
#!/bin/bash
##################################################
# Find a string in package files (Arch Linux)
#
# Usage:
# bash ./findstr.sh <executable name> <searchable string>
#
# 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

Loading…
Cancel
Save