Comment by tlb

Comment by tlb 2 days ago

4 replies

Exec doesn't know about shell aliases. Only what's in the $PATH.

I liked the shell in MPW (Mac Programmer's Workshop, pre-NeXT) where common commands had both long names and short ones. You'd type the short ones at the prompt, but use the long, unambiguous ones in scripts.

Kwpolska 2 days ago

PowerShell has long commands and short aliases, but the aliases can still shadow executables, e.g. the `sc` alias for `Set-Content` shadows `sc.exe` for configuring services. And you only notice when you see no output and weird text files in the current working directory.

szszrk 2 days ago

Networking crowd probably think it's obvious. Because of things like Cisco cli, or even Mikrotik. Or "ip" cli as well, I guess.

I never bothered to check what's the origin of that pattern.

  • hnlmorg 2 days ago

    Ive taken entire web farms offline due to an unexpected expansion of a command on a Cisco load balancer.

    The command in question was:

        administer-all-port-shutdown 
    
    (Or something to that effect —it’s been many years now)

    And so I went to log in via serial port (like I said, *many years ago so this device didn’t have SSH), didn’t get the prompt I was expecting. So typed the user name again:

        admin
    
    And shortly afterwards all of our alarms started going off.

    The worst part of the story is that this happened twice before I realised what I’d done!

    I still maintain that the full command is a stupid name if it means a phrase as common as “admin” can turn your load balancer off. But I also learned a few valuable lessons about being more careful when running commands on Cisco gear.

skykooler 2 days ago

Theoretically you could do this in Linux by calling /usr/bin/sl or whatever - but since various distros put binaries in different places, that would probably cause more problems than it could solve.