On 06/07/2015 at 08:18 AM, Emanuel Berg wrote: > On my school's SunOS there are a lot of tools that > sound the same but aren't exactly the same as the GNU > tools that I'm accustomed with from Debian. This is > confusing and error-prone. > > For example > > du > > isn't GNU du(1) but a binary on the SunOS system: > > /usr/bin/du > > and there is also > > /usr/ucb/du > > However, GNU du *is* installed, in > > /it/sw/gnutools/bin/du > > And this is the same for so many tools: ls, grep, ... > > So the question is: how can I make the GNU toolchain > the favored alternative when there are several > executables? Without setting aliases one by one... (I > use zsh.)
Modify your shell config file to prepend /it/sw/gnutools/bin/ to PATH, then launch a new instance of the shell. I don't know the filename or appropriate syntax for that file for zsh, but with bash it would be ~/.bashrc (or /etc/profile, or any file invoked from either) and PATH=/it/sq/gnutools/bin:"$PATH" and it's exceedingly unlikely that zsh doesn't have comparable functionality, even if with different syntax. (Actually, I think the functionality may be specified by POSIX, though I can't swear to that without research.) -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
signature.asc
Description: OpenPGP digital signature