1

I have a number of bash functions which I source from my .bashrc. I also have a bunch of support function that are needed but do not want them to show up in a terminal session when a user does tab-completion.

My bash functions start with xepty-. Support functions also start with xepty-. Thus when users are in a terminal window, and they input xepty-Tab, they get a large number of matches. Is it possible to make the support functions unavailable for use in the terminal session?

9
  • .bashrc is the initialization file for interactive sessions. Why are the functions there if you don't want to use them in interactive sessions? Are they just supposed to be used internally to .bashrc itself? Commented Oct 10, 2022 at 0:41
  • 2
    It would be simpler to rename the support functions, e.g. as _xepty- and leave the functions that are expected to be used interactively as xepty-. Commented Oct 10, 2022 at 0:43
  • Yes, there are many which would be of no interest to the user, but are used internally by the functions that users would actually use. Commented Oct 10, 2022 at 0:50
  • How is it that the functions that you define in your user .bashrc end up in other users interactive shells? You do need to split "personal" scripts from "system" scripts. Commented Oct 10, 2022 at 2:59
  • Many want to use them, so they source them from their .bashrc, but the support functions won't be useful for them to run. Commented Oct 10, 2022 at 11:07

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.