From cd307765e514d79cfbbcbc651af7737bc3a4d7f8 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 17 Mar 2014 14:29:09 +0100 Subject: [PATCH] use tr to split words, remove command redundancy --- sh/tmuxwords.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sh/tmuxwords.sh b/sh/tmuxwords.sh index 40590a1..f0058c3 100644 --- a/sh/tmuxwords.sh +++ b/sh/tmuxwords.sh @@ -16,10 +16,8 @@ allwords() { while read active pane; do [[ "$active" -eq 0 ]] && tmux capture-pane -J -p -t "$pane" done | - fmt -1 | - sed -e 'p;s/[^a-zA-Z0-9_]/ /g' | - fmt -1 | - sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' + tr -s '[:space:]' '\n' | + sed -e 'p;s/[^a-zA-Z0-9_]\+/\n/g' } # take all pane words