cat global_features_script.sh
.child1_script.sh
.child2_script.sh
function svn_credentials
{
echo -n "Enter the svn username and press [ENTER]: " > /dev/tty
read svn_username
echo -n "Enter the svn commit message and press [ENTER]: " > /dev/tty
read svn_message
echo -n "Enter your svn password and press [ENTER]: " > /dev/tty
read -s svn_password
}
if [ a == b]
then
echo "a is equal to be b"
else
echo "a is not equal to b"
fi
function exit_error
{
echo " There is an error in the command, please check it"
exit 1
}
cat child_script.sh
. global_features_script.sh
svn_wc=temp_dir
svn_credentials # calling function from global_features_script.sh
svn commit $svn_wc -m "$svn_message" --username $svn_username --password $svn_password
私が実行すると:。child_script.sh
予想される出力: global_features_script.sh から 1 つの関数 (svn_credenttails) だけを実行する必要があります
私が得ている出力は次のとおりです:global_features_script.shにリストされている他のすべての関数と他のシェルスクリプトを呼び出しています