![]() |
|
|
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 |
| oracle connection from shell script | DILEEP410 | Shell Programming and Scripting | 4 | 07-01-2009 03:19 AM |
| sybase connection through shell-script | Amitabh | UNIX for Dummies Questions & Answers | 9 | 04-10-2009 11:34 PM |
| Connection to database through shell script | ravi214u | Shell Programming and Scripting | 1 | 01-08-2009 05:44 PM |
| status bar in shell script or perl | learnbash | Shell Programming and Scripting | 2 | 11-16-2008 11:17 AM |
| Telnet script to test open ports on mult servers | liketheshell | Shell Programming and Scripting | 2 | 02-15-2008 12:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
Hi, Code:
MACHINE=10.2.191.100
MACHINE=10.1.101.100
MACHINE=10.3.181.100
exec 3>/dev/tcp/${MACHINE}:2061
if [ $? -eq 0 ]
then
echo "Telnet accepting connections"
else
echo "Telnet connections not possible"
fi
Code:
bash-2.03$ MACHINE=10.2.191.100
bash-2.03$ MACHINE=10.1.101.100
bash-2.03$ MACHINE=10.3.181.100
bash-2.03$ exec 3>/dev/tcp/${MACHINE}:2061
bash: /dev/tcp/10.3.181.100:2061: Not a directory
bash-2.03$ if [ $? -eq 0 ]
> then
> echo "Telnet accepting connections"
> else
> echo "Telnet connections not possible"
> fi
Telnet connections not possible
Many Thanks |
|
|||||
|
Quote:
And you might want to start with some basic texts about shell programming, because that is not how you construct a loop (except maybe if you can create a DWIMTD function). There's a good introduction available here. It's written for Linux, but there are very few specific things used, most applies to any platform that bash runs on. Code:
MACHINES="10.2.191.100 10.1.101.100 10.3.181.100"
for MACHINE in ${MACHINES}
do
exec 3>/dev/tcp/${MACHINE}/2061
if [ $? -eq 0 ]
then
echo "${MACHINE}: Telnet accepting connections"
else
echo "${MACHINE}: Telnet connections not possible"
fi
done
|
|
||||
|
Quote:
THanks! |
![]() |
| Bookmarks |
| Tags |
| grep or |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|