hi guys
I'm new in linux and bash
I have 2 file
t1.sh & t2.sh
t2.sh
Code:
myFun(){
echo "input is ${1}"
}
t1.sh
Code:
echo "say something"
read x
sh t2.sh
I want call myFun function from t1.sh file
NOTE:
I know how to invoke a function, the following code will work good
Code:
myFun(){
echo "input is ${1}"
}
myFun ${1}
but I want call myFun() directly from t1.sh
i mean this
Code:
myFun(){
echo "input is ${1}"
}
#myFun ${1} // invoke it from t1.sh, something like (myObject.myFun() in java )
how can i do this?
it drives me crazy
