01-22-2009
That white space may not be the white space you think it is? Try matching anything... if that works, do the same for the second pattern match.
$telnet->waitfor('/USERCODE:.*$/i');
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
can someone tell me how i can write a shell script that will automatically log me in to any machines i want without bothering me for some password input? (i know i have to put in a password but I would like to take care of that in the script)
can anyone help me here? (2 Replies)
Discussion started by: TRUEST
2 Replies
2. UNIX for Dummies Questions & Answers
Hi quick question from a unix newbie
Working on a project to get me using unix, the point of this project is to find a printer on the network check for jobs in the printer if the printer has no jobs do nothing if the printer has jobs then check the status for errors and e-mail the user. This... (2 Replies)
Discussion started by: w33man
2 Replies
3. Shell Programming and Scripting
Hi, im brasilian, sorry for bad english ok? Well, im writing one honeypot, look:
#!/bin/bash
echo ""
echo `cat /etc/welcome.pot`
echo ""
echo -n "login: "; read usuario
echo -n "Password: "
#stty -echo
read -s senha
#stty echo
exit
Running it in localhost, thats right:
... (1 Reply)
Discussion started by: juniordevil
1 Replies
4. Shell Programming and Scripting
Somewhat long story:
I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage.
This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies
5. Shell Programming and Scripting
Hi everybody,
I am thinking on writing a shell script to telnet to Cisco routers, and I am looking for help. I have researched some and could not find much on the topic, or at least much of help anyway...
I read "expect" is one solution, but I am looking for something more flexible, as I... (1 Reply)
Discussion started by: ppucci
1 Replies
6. Shell Programming and Scripting
Hi
How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies
7. What is on Your Mind?
Hi all,
I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first.
Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies
8. Web Development
i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies
9. Shell Programming and Scripting
i have written a script as shown below :
telnet 10.161.240.2 8100
<?xml version="1.0"?> <login_command> <sequence id="1" /> <access id="1"/> <user name = "user1" password = "pass"/> </login_command>
<?xml version="1.0"?> <RegistrationDescriptor> <sequence id="1" /> <access id="1"/>... (4 Replies)
Discussion started by: akrati1
4 Replies
10. Shell Programming and Scripting
I am trying to build and expect script to log into multiple aix boxes and change password. I need for the script to terminate if it cannot log into a server because the username or password is wrong.
#!/usr/bin/expect
set timeout 1
set host
set user
set password
set uh "Unknown host"
set... (3 Replies)
Discussion started by: leemalloy
3 Replies
LEARN ABOUT DEBIAN
ns_strnstr
Ns_String(3aolserver) AOLserver Library Procedures Ns_String(3aolserver)
__________________________________________________________________________________________________________________________________________________
NAME
Ns_Match, Ns_NextWord, Ns_StrCaseFind, Ns_StrCopy, Ns_StrDup, Ns_StrNStr, Ns_StrToLower, Ns_StrToUpper, Ns_StrTrim, Ns_StrTrimLeft, Ns_Str-
TrimRight, Ns_StringPrint, ns_strcopy, ns_strdup - library procedures
SYNOPSIS
#include "ns.h"
char *
Ns_Match(char *a, char *b)
char *
Ns_NextWord(char *line)
char *
Ns_StrCaseFind(char *s1, char *s2)
char *
Ns_StrCopy(char *str)
ns_strcopy(char *str)
char *
Ns_StrDup(char *str)
ns_strdup(char *str)
char *
Ns_StrNStr(char *pattern, char *expression)
char *
Ns_StrToLower(char *string)
char *
Ns_StrToUpper(char *string)
char *
Ns_StrTrim(char *string)
char *
Ns_StrTrimLeft(char *string)
char *
Ns_StrTrimRight(char *string)
void
Ns_StringPrint(char *string)
_________________________________________________________________
DESCRIPTION
Ns_Match(a, b)
Compare the beginnings of two strings, case insensitively. The comparison stops when the end of the shorter string is reached.
Return NULL if no match, b if match.
Ns_NextWord(line)
Return a pointer to first character of the next word in a string; words are separated by white space. The returned pointer points
into the original string. For example, Ns_NextWord("abc def") returns a pointer to the 'd' in that string.
Ns_StrCaseFind(s1, s2)
Locate the first occurrence of substring s2 within string s1 in a case-insensitive manner. The terminating ' ' characters are not
compared. Returns a pointer that points into s1. Uses strstr(3) to do its work.
Ns_StrCopy(str)
ns_strcopy(str)
Copy a string or NULL value using Ns_Malloc. The Ns_StrCopy function is identical to the Ns_StrDup function but allows for the
string parameter to be NULL, in which case Ns_StrCopy does nothing and returns NULL.
Ns_StrDup(str)
ns_strdup(str)
Copy a string using Ns_Malloc. The Ns_StrDup function calls Ns_Malloc to allocate enough memory to make a copy of the given string.
Ns_StrNStr(pattern, expression)
Search through pattern for expression, case insensitively. Return a pointer that points to where the match begins within pattern, or
NULL if expression is not contained in pattern.
Ns_StrToLower(string)
Convert string to lowercase. Returns pointer to original string. Original string will be modified.
Ns_StrToUpper(string)
Convert string to uppercase. Returns pointer to original string. Original string will be modified.
Ns_StrTrim(string)
Trim leading and trailing white space from string. A pointer to the trimmed string will be returned, which will be in the original
string. Do not lose your original pointer to the string if you later need to free it.
Ns_StrTrimLeft(string)
Trim leading white space from string. A pointer to the trimmed string will be returned, which will be in the original string. Do not
lose your original pointer to the string if you later need to free it.
Ns_StrTrimRight(string)
Trim trailing white space from string. The original string pointer will be returned, but the string will have been modified: a ' 's
will have been placed right after the last non-whitespace character of the string.
Ns_StringPrint(string)
Print a string to stdout.
SEE ALSO
nsd(1), info(n)
KEYWORDS
AOLserver 4.0 Ns_String(3aolserver)