You can execute commands in another script simply calling it... if you want to "define" functions or aliases in the child script then you must to execute the commands in the same environment... how you do that? If you are in the Bourne Shell, the Korn Shell or Bourne Again Shell (sh,ksh,bsh) you must to use
[tt]
. /name/of/script
[/tt]
If you are in the C Shell or derivatives like TCSh you must to use
[tt]
source /name/of/script
[/tt]
If you call...
<path>/myscript.sh < /tmp/myinput
then this will read input...
alternatively if they both run at once you could create a pipe from one to the other...
<path>/myfirstscript | <path>/myusingscript.sh
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.