Skip to content
Myr

[bash,zsh] Remove redundant filtering-out of comment/blank lines

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Comments are anyway removed in the subsequent call to `sub(/#.*/, "")`, and it becomes a blank line. Blank lines do not have fields, so they are ignored in the next for-loop.

authored by Koichi Murase · committed by Junegunn Choi · parent adc9ad2 · Browse files · 2 files+0 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+0 added−8 removed

  • other:+0 added−8 removed

2 files+0 added−8 removed

modified:shell/completion.bash-4 removed
511 unmodified lines
512 ' ~/.ssh/known_hosts 2> /dev/null513 ) \514 <(515 __fzf_exec_awk '516 # Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of517 # the form [[:blank:]], and Ubuntu 18.04 LTS still uses this518 # 16-year-old mawk unfortunately. We need to use [ \t] instead.519 /^[ \t]*(#|$)/ { next }516 {517 sub(/#.*/, "")518 for (i = 2; i <= NF; i++)519 if ($i != "0.0.0.0")
163 unmodified lines
modified:shell/completion.zsh-4 removed
289 unmodified lines
290 ' ~/.ssh/known_hosts 2> /dev/null291 ) \292 <(293 __fzf_exec_awk '294 # Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of295 # the form [[:blank:]], and Ubuntu 18.04 LTS still uses this296 # 16-year-old mawk unfortunately. We need to use [ \t] instead.297 /^[ \t]*(#|$)/ { next }294 {295 sub(/#.*/, "")296 for (i = 2; i <= NF; i++)297 if ($i != "0.0.0.0")
170 unmodified lines