![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Standard UNIX functions | Zipi | High Level Programming | 2 | 02-23-2009 12:41 PM |
| Similar functions in unix | dayakarr | High Level Programming | 1 | 02-14-2009 10:44 AM |
| Excuting UNIX Functions under several username and host | samvino | Shell Programming and Scripting | 1 | 07-01-2008 10:44 AM |
| newbie to unix programming in C, needed a few simple prgs on these functions! | wrapster | High Level Programming | 1 | 06-22-2008 01:12 PM |
| Use of functions | amitrajvarma | Shell Programming and Scripting | 1 | 11-23-2007 06:52 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
unix functions
Hi All,
i have two functions in my script. Code:
question()
{
num=`ps -e | grep ps | awk -F" " '{print $1}'`
qno=`expr $num % 10`
grade=grade1
cat grade1/$qno
answer ${grade} ${qno}
}
answer()
{
grade=$1
qno=$2
ansno=`wc -l $grade/ans/$qno | cut -d' ' -f1`
j=0
while [ $j -lt $ansno ]
do
echo select your answer
read ans[$j]
echo "do you want to select one more answer?"
read ch
if [ $ch != y ]
then
break;
fi
j=`expr $j + 1`
done
k=0
exec < $grade/ans/$qno
while read line
do
echo line=$line
while [ $k -lt $ansno ]
do
if [ ${ans[$k]} = $line ]
then
echo "equal"
else
echo "not equal"
fi
k=`expr $k + 1`
done
done
}
can you please help? thanks Last edited by Yogesh Sawant; 03-25-2009 at 02:28 AM.. Reason: added code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|