On Sun, Feb 07, 2010 at 08:30:00AM -0500, Paul Hoffman wrote: > Sorry if this is nitpicky, but you can save two processes by putting > more logic in your awk code, e.g.: > > unattached=$(tmux "$@" list-sessions | awk '!/attached/ { print $1; exit > }') > ... > attached=$(tmux "$@" list-sessions | awk '/attached/ { print $1; exit }')
Heh. I had noticed that I could avoid the grep by doing the pattern matching in awk, right after I sent it out. I didn't notice that head was also avoidable. I was also hoping for comments about how usable this setup was for people, but nit-picking's also good. -- Aaron Denney -><- ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users