Skip to content

Commit c68ca72

Browse files
wrptony
authored andcommitted
Use awk instead of grep|cut
1 parent cb65484 commit c68ca72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manuscript/06-window.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ Layouts can also be custom. To get the custom layout snippet for your current
141141
window, try this:
142142

143143
{language=shell, line-numbers=off}
144-
$ tmux lsw -F "#{window_active} #{window_layout}" | grep "^1" | cut -d " " -f2
144+
$ tmux lsw -F "#{window_active} #{window_layout}" | awk '$1{print $2}'
145145

146146
To apply this layout:
147147

148148
{language=shell, line-numbers=off}
149-
$ tmux lsw -F "#{window_active} #{window_layout}" | grep "^1" | cut -d " " -f2
149+
$ tmux lsw -F "#{window_active} #{window_layout}" | awk '$1{print $2}'
150150
> 5aed,176x79,0,0[176x59,0,0,0,176x19,0,60{87x19,0,60,1,88x19,88,60,2}]
151151

152152
# resize your panes or try doing this in another window to see the outcome

0 commit comments

Comments
 (0)