Carter Sanders
unread,Jul 23, 2012, 5:29:00 PM7/23/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
As the subject line says, I'd like a quicker way to type "2>&1 | tee build.log"
Or even better, I'd like a shortcut which did expanded to 2>&1 | tee $1.$2.log" where $1 and $2 are taken from the current line.
I've tried a few different things and here are the problems I found
1. Aliases seem to apply to first words (or first word after another alias) only. So I'm pretty sure they can't help.
2. A function can work - e.g. "log ant compile", but it has the undesirable side effect of breaking bash completion as it moves the first arg to the second and then subcommands expansion won't work
3. A variable can sort of work e.g LOG='2>&1 | tee build.log', except it must be expanded manually with an esc-ctrl-E or the 2>&1 gets passed a parameter.
Does anybody know a better way to do this?
Thanks-
Carter