Bash – How to use – as alias

aliasbash

When I was using openSUSE 11.3, it came with several aliases already set up. Two that I used a lot were + for pushd . and - for popd. Now on Debian, I can't figure out how to create the second one. alias -=popd tries to read -= as a command option to alias. I've tried putting quotes (both single and double) around it, and preceding it with a backslash, but I just keep getting error messages. Any suggestions?

Thanks

Best Answer

try this:

alias -- -=popd

worked at least for me:

usr@srv % alias -- -=echo
usr@srv % - test
test