Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thanks. I edited the question to clarify something I forgot to clarify: I sourced the file containing the function from bashrc and then sourced the relevant bashrc itself. I am surprised it still isn't enough to call the function from the aforementioned script-file (but enough for manual call from terminal). Commented Mar 4, 2018 at 13:07
  • 2
    Oh, I think I understand now, although the function-file is sourced from bashrc it isn't exported, hence not available for sub-processes like the script file I ran. Thus, I should export the function file and in bashrc, and not just source it there. Commented Mar 4, 2018 at 13:29
  • After the function definition, use export -f tdm (or export -f rse or whatever the function was called). Commented Mar 4, 2018 at 13:37
  • 1
    Did that (in bashrc) then the function ran indeed from the script. Thanks. Commented Mar 4, 2018 at 14:07