Aside:
What do you mean by "use a symbolic link" (I'm familiar with `ln -s` fwiw) the alias carries the command switch, how do you do that with a link?
# example
alias egrep='grep -E'
??What do you mean by "use a symbolic link" (I'm familiar with `ln -s` fwiw) the alias carries the command switch, how do you do that with a link?
# example
alias egrep='grep -E'
?? #!/bin/sh
exec /usr/bin/grep -E "$@"
but that would mess up help messages and probably also needs disaster handling in case exec fails). Another traditional way, however, is to symlink everything to a single binary, which uses argv[0] or getprogname() to see which name the user called it under and acts accordingly. In the extreme case, you get the "multi-call binaries" Busybox or Toybox, which contain an entire set of Unix utilities in a single (not-too-slim) executable image. GNU grep also used that technique at some point in its history, but it was discarded for a reason I don't recall. cat `which egrep`
#!/bin/sh
exec grep -E "$@"
But I agree that it would be cleaner and trivial to implement this behavior by depending on argv[0], GNU style guide be damned. /some/path/fgrep
it adds the -E flag. A hard link works OK too, as done copying the whole binary.