Start all of your commands with a comma (2009)
rhodesmill.org
Start all of your commands with a comma (2009)
1–10 of 130 posts
Re: Start all of your commands with a comma (2009)
#2Re: Start all of your commands with a comma (2009)
#3This is a good trick to avoid collisions with system commands. Anytime you add one of your own executables to PATH, prefix it with a comma (,). This way you avoid name collisions and have a handy way of seeing what commands are available on your system using tab completion (, then tab lists all of your personal executables)
Re: Start all of your commands with a comma (2009)
#4I have a script that creates new ~/bin scripts that checks for collisions locally (functions, builtins, and executables) and in linux distros.
For example, I have a ~/bin/up script on every box and platform to install updates. So far so good on collisions.
Re: Start all of your commands with a comma (2009)
#5Re: Start all of your commands with a comma (2009)
#6Quoted post unavailable.
Re: Start all of your commands with a comma (2009)
#7Quoted post unavailable.
Re: Start all of your commands with a comma (2009)
#8 $ mkdir -p /tmp/bin/my
$ printf '%s\n%s\n' '#!/bin/sh' 'echo hello' > /tmp/bin/my/hello
$ chmod 755 /tmp/bin/my/hello
$ PATH="/tmp/bin:$PATH"
$ my/hello
helloRe: Start all of your commands with a comma (2009)
#9Re: Start all of your commands with a comma (2009)
#10Clever trick. Too bad there's no good way to namespace commands. It would be interesting if you could have, for instance: $ mkdir -p /tmp/bin/my $ printf '%s\n%s\n' '#!/bin/sh' 'echo hello' > /tmp/bin/my/hello $ chmod 755 /tmp/bin/my/hello $ PATH="/tmp/bin:$PATH" $ my/hello hello
,my,hello