**BASH SHELL; DEBIAN STRETCH**

As seen [here][1], I've created a "seems to work OK, most of the time" alias function for the **su** command (actually, I'm not able to find any problems with it...yet). I've inserted it into my **/etc/bash.bashrc** file.

`function su() { if [[ $1 == "--" ]]; then command su "$@"; else command su -l "$@"; fi; }`

However, I know it could probably stand some improvement.

*(What I want this function to accomplish is rather simple. If I could use regular aliases, I'd want something like:*

`alias su='su -l` AND `alias 'su --'=su`

*However, I realize that the name of an alias can't have spaces...and the logic seems a bit circular...*)

**Does my shell function have any hidden traps? Will it negatively affect the operation of "su" if a different option is called (e.g. "su -c")?**


  [1]: https://unix.stackexchange.com/a/741253/144299