From b107581b2f22b7c9c69fc6aa43f31794bfed7689 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 16 Aug 2016 21:20:29 -0700 Subject: [PATCH] Add filter_by_column_value shell function --- dotfiles/lib/shellenv/functions.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dotfiles/lib/shellenv/functions.sh b/dotfiles/lib/shellenv/functions.sh index 2e49a621..660e2acc 100644 --- a/dotfiles/lib/shellenv/functions.sh +++ b/dotfiles/lib/shellenv/functions.sh @@ -108,6 +108,10 @@ function get_cols() { awk -f "$HOME/.lib/get_cols.awk" -v "cols=$*" -v "FS=$FS" } +function filter_by_column_value { + awk '$'"$1"' == '"$2"' { print $0 }' +} + function find_all_ssh_agent_sockets() { find /tmp -type s -name agent.\* 2> /dev/null | grep '/tmp/ssh-.*/agent.*' }