From 06fe6aaaea7b41cdad5b36bb2d3797521b7dca31 Mon Sep 17 00:00:00 2001 From: "colicarr@cisco.com" <111186308+colicarr@users.noreply.github.com> Date: Sat, 13 Aug 2022 10:44:47 -0400 Subject: [PATCH] silence awk: cmd. line:1: warning When using Includes with ssh/config esp: ---config--- Include config.d/* Include config.d/**/* --- ssh host causes a warning and obfuscates the completions. awk: cmd. line:1: warning: command line argument `/Users/yourHome/.ssh/config.d/SetOfHosts' is a directory: skipped AWK has a long history of having strong feelings against directories, going back to the POSIX version, and would terminate. This is an order of magnitude along that of clowns' dislike of mimes but with age awk's strong feelings toward directories "mellowed" into warnings (gawk). Sometimes we just need bash completions without the editorial opinions from awk and this appears to be the best move to silence a AWK. --- shell/completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/completion.bash b/shell/completion.bash index 69b88165eeb..71eb6a0a48c 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -283,7 +283,7 @@ _fzf_host_completion() { <(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \ <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') | awk '{if (length($2) > 0) {print $2}}' | sort -u - ) + ) 2> /dev/null } _fzf_var_completion() {