![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parent not waiting until child complete executing another program through execl() | vvaidyan | High Level Programming | 4 | 05-16-2008 07:00 AM |
| complete noob | avdrummerboy | UNIX for Dummies Questions & Answers | 3 | 12-04-2006 12:25 PM |
| Auto complete | Tom_Zamani | UNIX Desktop for Dummies Questions & Answers | 4 | 07-28-2005 06:30 AM |
| Auto Complete under AIX | truma1 | UNIX for Advanced & Expert Users | 7 | 10-11-2001 12:08 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Please complete this program.
Hi All,
I need some help to complete the below script, after executing below script blank lines are coming, but i am expecting 4 digit numeric no. Please solve the issue ASAP. function portno { while (true) do random=`echo $RANDOM | cut -c 1-4` port=`netstat -a | grep -c $random` if [ $port -ne 1 ]; then break else continue fi done return $port } port1=`portno` port2=`portno` echo "$port1" echo "$port2" Code:
function portno
{
while (true)
do
random=`echo $RANDOM | cut -c 1-4`
port=`netstat -a | grep -c $random`
if [ $port -ne 1 ];
then
break
else
continue
fi
done
return $port
}
port1=`portno`
port2=`portno`
echo "$port1"
echo "$port2"
Code:
function portno
{
while (true)
do
random=`echo $RANDOM | cut -c 1-4`
port=`netstat -a | grep -c $random`
if [ $port -ne 1 ];
then
break
else
continue
fi
done
return $port
}
port1=`portno`
port2=`portno`
echo "$port1"
echo "$port2"
Thanks in advance...Regards, Sridhar. Last edited by blowtorch; 01-15-2008 at 08:24 PM.. Reason: code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|