SETLOCAL ... ALIAS ... pipes

rconn

Administrator
Staff member
May 14, 2008
10,653
97
#2
WAD. SETLOCAL switches aliases from global to local, because users were complaining that when they modified an alias inside SETLOCAL it was affecting all of their sessions. Thus far, you're the only one who's *wanted* a change inside SETLOCAL to affect everything.

There is no way to turn that off.
 
#3
It's not important. For years the text utils (grep, ...) from the ancient Thompson ToolKit have been in my PATH. They're simple and pretty easy to use and I'm quite accustomed to them. But I also have the (Gnu) UNXUTILS collection of tools which are significantly more powerful. I needed the Gnu utils in a project so I made some aliases to keep coding down. For example, these
Code:
alias gsort `(2>nul g:\gnu\sort.exe %$)`
alias gcut `g:\gnu\cut.exe %$`
alias guniq `g:\gnu\uniq.exe %$`
alias ggrep `g:\gnu\grep.exe %$`
made the likes of this
Code:
gcut -f 3 all.log | gsort -n | guniq -c | gsort -r | head /n %count
easier to code (and easier to read).
I was surprised when it didn't work inside SETLOCAL.

So, a question. If I (finally) move to a 64-bit OS, will things like the above still work with those 32-bit utilities?