Sponsored Content
Full Discussion: where's the bug?
Top Forums UNIX for Dummies Questions & Answers where's the bug? Post 302230791 by era on Sunday 31st of August 2008 11:37:46 AM
Old 08-31-2008
Quote:
Originally Posted by jon80
if [1 eq 1] then
You need to have spaces inside the square brackets; [ is the name of a command so it needs to be a separate token, and it looks for a lone closing ] token.
 

8 More Discussions You Might Find Interesting

1. Programming

Bug has developed

Guys there is another bug that has developed.........now messaged above 6 bytes are trimmed and echoed back to client.After the first message the echo is not regular.I have put a loop in both client and server to check for closing.Moreover for connection close i also need to put another clause that... (3 Replies)
Discussion started by: arjunjag
3 Replies

2. Post Here to Contact Site Administrators and Moderators

Have I found a bug?

When searching for new posts, I see that my voting in one of the polls counts as a 'new post'. However, while the '<blah> minutes ago' entry updates correctly, the 'by <username>' is the last user to actually post a comment in the poll instead. Result: Poll: vB Guest Book 39... (4 Replies)
Discussion started by: Smiling Dragon
4 Replies

3. UNIX for Advanced & Expert Users

logrotate bug?

I have been mailing myself logs for a while, but just ran into a problem because of a process that cannot HUP its log. (I realize thats why they implemented the "copytruncate" option in the first place) When I use logrotate with "copytruncate" and "compress" there is a problem. The "myScript"... (0 Replies)
Discussion started by: jjinno
0 Replies

4. Shell Programming and Scripting

Is it a bug ..?

Hi All, I am using Red Hat Linux on my servers. The problem that I am facing is, sometimes the /opt usage on the server shows used percentage as 100% , when actually it is simply 20%. When I reboot the system, it comes back to 20%.Is this a bug in the system or my settings have gone wrong... (1 Reply)
Discussion started by: nua7
1 Replies

5. AIX

bug in 43 ???

xxxxserver# lsattr -El inet0 | grep 255.240.0.0,32.224.0.0,32.78.120.254 | grep '.40' route net,-hopcount,1,-netmask,255.240.0.0,32.224.0.0,32.78.120.254 How this is possible? (1 Reply)
Discussion started by: itik
1 Replies

6. Programming

is this a bug of g++?

Hello, Im using the g++(g++ Ubuntu/Linaro 4.4.4-14ubuntu5 4.4.5) and im trying to compile a small snippet code and got into an endless loop.I recompiled that in VS2010 under Windows 7 and the answer is as expected.so i wonder is this a bug of g++?here is my code. #include<iostream> using... (5 Replies)
Discussion started by: homeboy
5 Replies

7. Shell Programming and Scripting

How to fix this bug?

Hi gurus, I have script as below: #!/bin/ksh while : do cat /dev/null > srcfile exit_time=`TZ=GMT-20 date +%Y%m%d1950` cur_time=`date +%Y%m%d%H%M` flag=1 if ; then ... (7 Replies)
Discussion started by: ken6503
7 Replies

8. UNIX for Advanced & Expert Users

A $(( expression )) bug?

This is for the big guns... I have been modifying AudioScope.sh to bring it inline with more current practices. I hit a bug which IS not present in the original code but was after modification. Shell check first:- #!/bin/sh txt="1234567890" echo "$(( $txt ))" echo "$(( ${#txt} - 1 ))" echo... (17 Replies)
Discussion started by: wisecracker
17 Replies
MKDoc::XML::Token(3pm)					User Contributed Perl Documentation				    MKDoc::XML::Token(3pm)

NAME
MKDoc::XML::Token - XML Token Object SYNOPSIS
my $tokens = MKDoc::XML::Tokenizer->process_data ($some_xml); foreach my $token (@{$tokens}) { print "'" . $token->as_string() . "' is text " if (defined $token->text()); print "'" . $token->as_string() . "' is a self closing tag " if (defined $token->tag_self_close()); print "'" . $token->as_string() . "' is an opening tag " if (defined $token->tag_open()); print "'" . $token->as_string() . "' is a closing tag " if (defined $token->tag_close()); print "'" . $token->as_string() . "' is a processing instruction " if (defined $token->pi()); print "'" . $token->as_string() . "' is a declaration " if (defined $token->declaration()); print "'" . $token->as_string() . "' is a comment " if (defined $token->comment()); print "'" . $token->as_string() . "' is a tag " if (defined $token->tag()); print "'" . $token->as_string() . "' is a pseudo-tag (NOT text and NOT tag) " if (defined $token->pseudotag()); print "'" . $token->as_string() . "' is a leaf token (NOT opening tag) " if (defined $token->leaf()); } SUMMARY
MKDoc::XML::Token is an object representing an XML token produced by MKDoc::XML::Tokenizer. It has a set of methods to identify the type of token it is, as well as to help building a parsed tree as in MKDoc::XML::TreeBuilder. API
my $token = new MKDoc::XML::Token ($string_token); Constructs a new MKDoc::XML::Token object. my $string_token = $token->as_string(); Returns the string representation of this token so that: MKDoc::XML::Token->new ($token)->as_string eq $token is a tautology. my $node = $token->leaf(); If this token is not an opening tag, this method will return its corresponding node structure as returned by $token->text(), $token->tag_self_close(), etc. Returns undef otherwise. my $node = $token->pseudotag(); If this token is a comment, declaration or processing instruction, this method will return $token->tag_comment(), $token_declaration() or $token->pi() resp. Returns undef otherwise. my $node = $token->tag(); If this token is an opening, closing, or self closing tag, this method will return $token->tag_open(), $token->tag_close() or $token->tag_self_close() resp. Returns undef otherwise. my $node = $token->comment(); If this token object represents a declaration, the following structure is returned: # this is <!-- I like Pie. Pie is good --> { _tag => '~comment', text => ' I like Pie. Pie is good ', } Returns undef otherwise. my $node = $token->declaration(); If this token object represents a declaration, the following structure is returned: # this is <!DOCTYPE foo> { _tag => '~declaration', text => 'DOCTYPE foo', } Returns undef otherwise. my $node = $token->pi(); If this token object represents a processing instruction, the following structure is returned: # this is <?xml version="1.0" charset="UTF-8"?> { _tag => '~pi', text => 'xml version="1.0" charset="UTF-8"', } Returns undef otherwise. my $node = $token->tag_open(); If this token object represents an opening tag, the following structure is returned: # this is <aTag foo="bar" baz="buz"> { _tag => 'aTag', _open => 1, _close => 0, foo => 'bar', baz => 'buz', } Returns undef otherwise. my $node = $token->tag_close(); If this token object represents a closing tag, the following structure is returned: # this is </aTag> { _tag => 'aTag', _open => 0, _close => 1, } Returns undef otherwise. my $node = $token->tag_self_close(); If this token object represents a self-closing tag, the following structure is returned: # this is <aTag foo="bar" baz="buz" /> { _tag => 'aTag', _open => 1, _close => 1, foo => 'bar', baz => 'buz', } Returns undef otherwise. my $node = $token->text(); If this token object represents a piece of text, then this text is returned. Returns undef otherwise. TRAP! $token->text() returns a false value if this text happens to be '0' or ''. So really you should use: if (defined $token->text()) { ... do stuff... } NOTES
MKDoc::XML::Token works with MKDoc::XML::Tokenizer, which can be used when building a full tree is not necessary. If you need to build a tree, look at MKDoc::XML::TreeBuilder. AUTHOR
Copyright 2003 - MKDoc Holdings Ltd. Author: Jean-Michel Hiver This module is free software and is distributed under the same license as Perl itself. Use it at your own risk. SEE ALSO
MKDoc::XML::Tokenizer MKDoc::XML::TreeBuilder perl v5.10.1 2004-10-06 MKDoc::XML::Token(3pm)
All times are GMT -4. The time now is 01:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy