i am unable to find what is wrong in my code
mu functionality is to exit from shell when i give 99 but it is not calling function ext
Could you please correct me.
read option
if [ "$option" == "99" ];
then
ext
else
echo "out"
fi
function ext
{
echo "tested 99 and exit is working"
}
---------- Post updated at 04:51 PM ---------- Previous update was at 03:35 PM ----------
Hello now i want to pass some string which always start with BDR but end charcters can be anything i just want to check if starting with BDR it must proceesd. But the script is not behaving like that
function ext
{
echo "THANK"
}
function upc
{
echo "TO EXPORT UPROC GIVE UPROC NAME"
echo "TO GO BACK PRESS 99"
read parm0
if [ "$parm0" == "BDR*" ];
then
$UXEXE/uxext upr upr=$parm0 output=$parm0.upr APP
echo "$output UPROC exported"
elif [ "$parm0" == "99" ];
then
start
else
echo "error in exporting"
fi
}
function start {
echo "FOR UPROC EXPORT PRESS 1"
echo "FOR SESSION EXPORT PRESS 2"
echo "FOR PLANNIFICATION EXPORT PRESS 3"
echo "TO EXIT PRESS 99"
read option1
if [ "$option1" == "1" ];
then
upc
elif [ "$option1" == "2" ];
then
echo "SESSION"
elif [ "$option1" == "3" ];
then
echo "PLAN "
elif [ "$option1" == "99" ];
then
ext
fi
}
echo " *****WELCOME****** "
echo " PLEASE PRESS 0 TO SERVE YOUR REQUEST "
echo " TO EXIT PRESS 99 "
read option
if [ "$option" == "99" ];
then
ext
elif [ "option" == "0" ];
echo "mahens"
then
start
fi
******************
for
do
done
***************
function upc
{
#for i in $var
echo "TO EXPORT UPROC GIVE UPROC NAME"
echo "TO GO BACK PRESS 99"
read parm0
if [ "$parm0" == "99" ];
then
start
else
$UXEXE/uxext upr upr=$parm0 output=$parm0.upr APP
echo "$output UPROC exported"
fi
*****************
i want to make functionality like if it meet my if conditin than it should again ask me that DO you want uproc to export
i mean it should go to
echo "TO EXPORT UPROC GIVE UPROC NAME"
echo "TO GO BACK PRESS 99"
how to exit from a unix for loop once inner loop is false
for i in `cat input.txt` ; do
a=`expr $a + 1`
echo $a
for j in `cat mnu.txt` ; do
b=`expr $b + 1`
echo $b
if [ $a == $b ];
echo "after a=b check"
echo $a
echo $b
then
echo "a and be are equal"
$UXEXE/uxext tsk ses=$i vses=* upr=* model mu=$j `output=$j_$i.pnf` APP
echo "$output PLANNIFICATION exported"
else
break
fi
done
echo "out of j loop"
done
for i in `cat input.txt` ; do
a=`expr $a + 1`
echo $a
for j in `cat mnu.txt` ; do
b=`expr $b + 1`
echo $b
if [ $a == $b ];
echo "after a=b check"
echo $a
echo $b
then
echo "a and be are equal"
$UXEXE/uxext tsk ses=$i vses=* upr=* model mu=$j `output=$j_$i.pnf` APP
echo "$output PLANNIFICATION exported"
else
f=1
break
fi
done
echo "out of j loop"
if [ $f -eq 1 ]; then
break
fi
done
this is correct but than fuunctionality is chaging the loop is outer loop is considering the value of a as 1 and value of b =2 so it will never meet the functionality
******************
it must be like first time both variable will be equal do the functionality
second time value of b != a so it must come out and enter the i loop
->now i must take the second line of the input file and compare it with the second line of b
Dear Franklin
my exact functionality is as follows:
1>the function pln must take the first line of data from the input.ksh then
2>it must take the first line of mnu.ksh and it must do
$UXEXE/uxext tsk ses=$i vses=* upr=* model mu=$j `output=$j_$i.pnf` APP
3>it must again than take the second line of input.ksh and 2 line of mnu and again it must perform
$UXEXE/uxext tsk ses=$i vses=* upr=* model mu=$j `output=$j_$i.pnf` APP
like this it must keep on doing till the end of both the files