2017-04-19 127 views
0

傳遞的輸入值到程序I在外殼腳本經由外殼腳本

#!/bin/sh 

echo "Enter name" 
read -r name 
echo "Enter email Id" 
read -r email 
echo "Enter the gender 
     choose among the following 
     (1-Male 
     2-Female 
     3-Others)" = "$num" 
    read -r num 

if [ "$num" = "1" ] 
then 
echo "MALE" 

elif [ "$num" = "2" ] 
then 
echo "FEMALE" 

elif [ "$num" = "3" ] 
then 
echo "OTHERS" 

fi 
echo "Do you nedd the pass book = $data_rep" 
read -r data_rep 
if [ "$data_rep" = "YES" ] 
then 
echo "YES" 
elif [ "$data_rep" = "NO" ] 
then 
echo "NO" 
fi 

echo "You entered name as" "$name" 
echo "You entered Email Id as" "$email" 
echo "You chose gender as" "$num" 
echo "You chose answer for passbook as" "$data_rep" 

以下用戶輸入代碼我想把上述用戶輸入添加到一個程序 該過程還具有相同的參數。 如何將用戶輸入的值傳遞給過程?

回答

0
sqlplus [email protected]$SID <<! 
$PWD 

exec procedure_name('$name','$email','$num'); 

! 

其中uid - 您的用戶名,SID - 你的Oracle TNSNAME,PWD - 口令