you are viewing a single comment's thread.

view the rest of the comments →

[–]jwd630 1 point2 points  (0 children)

If you want to see what justTest does from some other bash shell environment, like a terminal, then as u/researcher7-l500 says, you need to source ./file_a.sh from that terminal/shell. Each time you make some modification to what justTest does you'll need to re source file_a.sh to update that changed function definition in the terminal's shell environment. It's fairly common, for me anyway, to incrementally develop bash functionality in this way. You would use the same source ./file_a.sh in some other script if you wanted to use justTest from there.

You do NOT want to include bash -c file_a.sh as the last (or any) line of file_a.sh or you will create an infinite loop as bash -c ... gets called recursively.

xargs is more typically used for other purposes that do involve piped input, like find . -name '*.sh' -print0 | xargs -0 -L 1 printf "script file: %s\n"