Sponsored Content
Full Discussion: string test?
Top Forums UNIX for Dummies Questions & Answers string test? Post 18509 by kapilv on Friday 29th of March 2002 04:44:23 AM
Old 03-29-2002
Hi

you can use the substr function of awk. For more details do a man awk and you will find it.

Hope this helps
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh - test if string contains alphanumeric...

Okay I will let users input spaces as well :) I am having a mental block. I have done a couple of searches but havent found anything that I understand (the likes of :alpha: and awk). Basically I want to give the user an option to enter some text which will go down as a field within a flat... (3 Replies)
Discussion started by: tugger
3 Replies

2. UNIX for Dummies Questions & Answers

test a string...

Hi! I'm using echo $string | grep "" -c to test in a script if a string is a number and it seems to work. But how can i find, for example, if a string is a four figures number ? Thanks to all! (2 Replies)
Discussion started by: Kaminski
2 Replies

3. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

4. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

5. Shell Programming and Scripting

string test in IF statement

How do I test multiple words in a string test like below: if ] then print "You entered $TBS name.\n" else print "You entered an incorrect response.\n" fi This test does not work. I have tried different syntax versions. How does this work? And is there a better way to do it? ... (10 Replies)
Discussion started by: djehresmann
10 Replies

6. Shell Programming and Scripting

Test of more than one number on the end of a string

Hi there, I have a bunch of interface names like e1000g0 nge1 dmfe3 I also have some that have longer (vlan tagged) names like e1000g123001 nge23003 e1000g999002 I need to determine whether the interface is one of the former or latter types and I would do that by seeing... (7 Replies)
Discussion started by: rethink
7 Replies

7. Shell Programming and Scripting

Test if string exists

How do I use bash to test whether a string occurs more than two times in a file? (2 Replies)
Discussion started by: locoroco
2 Replies

8. Shell Programming and Scripting

string test

How do I use bash to test if a line begins with a random number of spaces followed by a letter? (1 Reply)
Discussion started by: locoroco
1 Replies

9. Shell Programming and Scripting

test for a blank string

Hi guys I am performing a simple test for a blank string with the following code: if ] ]] ; then echo "Blanks are NOT a valid input " return 1 fi The above fails giving a syntax error message: syntax error at line 142 : `=~' unexpected I am in ksh88 is there... (2 Replies)
Discussion started by: aoussenko
2 Replies

10. Shell Programming and Scripting

To test whether a field contains string value

I want to find whether string values are available in a field of a file. Let it be any character other than number . I just want to know whether characters will be available in it . Please share a single step command for this without creating a shell script. (5 Replies)
Discussion started by: Sang
5 Replies
Net::Jabber::Dialback::Verify(3pm)			User Contributed Perl Documentation			Net::Jabber::Dialback::Verify(3pm)

NAME
Net::Jabber::Dialback::Verify - Jabber Dialback Verify Module SYNOPSIS
Net::Jabber::Dialback::Verify is a companion to the Net::Jabber::Dialback module. It provides the user a simple interface to set and retrieve all parts of a Jabber Dialback Verify. DESCRIPTION
To initialize the Verify with a Jabber <db:*/> you must pass it the XML::Stream hash. For example: my $dialback = new Net::Jabber::Dialback::Verify(%hash); There has been a change from the old way of handling the callbacks. You no longer have to do the above yourself, a NJ::Dialback::Verify object is passed to the callback function for the message. Also, the first argument to the callback functions is the session ID from XML::Streams. There are some cases where you might want this information, like if you created a Client that connects to two servers at once, or for writing a mini server. use Net::Jabber qw(Server); sub dialbackVerify { my ($sid,$Verify) = @_; . . . } You now have access to all of the retrieval functions available. To create a new dialback to send to the server: use Net::Jabber qw(Server); $Verify = new Net::Jabber::Dialback::Verify(); Now you can call the creation functions below to populate the tag before sending it. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions $to = $Verify->GetTo(); $from = $Verify->GetFrom(); $type = $Verify->GetType(); $id = $Verify->GetID(); $data = $Verify->GetData(); $str = $Verify->GetXML(); @dialback = $Verify->GetTree(); Creation functions $Verify->SetVerify(from=>"jabber.org", to=>"jabber.com", id=>id, data=>key); $Verify->SetTo("jabber.org"); $Verify->SetFrom("jabber.com"); $Verify->SetType("valid"); $Verify->SetID(id); $Verify->SetData(key); Test functions $test = $Verify->DefinedTo(); $test = $Verify->DefinedFrom(); $test = $Verify->DefinedType(); $test = $Verify->DefinedID(); METHODS
Retrieval functions GetTo() - returns a string with server that the <db:verify/> is being sent to. GetFrom() - returns a string with server that the <db:verify/> is being sent from. GetType() - returns a string with the type <db:verify/> this is. GetID() - returns a string with the id <db:verify/> this is. GetData() - returns a string with the cdata of the <db:verify/>. GetXML() - returns the XML string that represents the <db:verify/>. This is used by the Send() function in Server.pm to send this object as a Jabber Dialback Verify. GetTree() - returns an array that contains the <db:verify/> tag in XML::Parser::Tree format. Creation functions SetVerify(to=>string, - set multiple fields in the <db:verify/> from=>string, at one time. This is a cumulative type=>string, and over writing action. If you set id=>string, the "from" attribute twice, the second data=>string) setting is what is used. If you set the type, and then set the data then both will be in the <db:verify/> tag. For valid settings read the specific Set functions below. SetTo(string) - sets the to attribute. SetFrom(string) - sets the from attribute. SetType(string) - sets the type attribute. Valid settings are: valid invalid SetID(string) - sets the id attribute. SetData(string) - sets the cdata of the <db:verify/>. Test functions DefinedTo() - returns 1 if the to attribute is defined in the <db:verify/>, 0 otherwise. DefinedFrom() - returns 1 if the from attribute is defined in the <db:verify/>, 0 otherwise. DefinedType() - returns 1 if the type attribute is defined in the <db:verify/>, 0 otherwise. DefinedID() - returns 1 if the id attribute is defined in the <db:verify/>, 0 otherwise. AUTHOR
By Ryan Eatmon in May of 2001 for http://jabber.org.. COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2004-08-17 Net::Jabber::Dialback::Verify(3pm)
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy