Sponsored Content
Top Forums UNIX for Dummies Questions & Answers New to shell script and lost.... Post 302247837 by LRoberts on Thursday 16th of October 2008 12:09:17 PM
Old 10-16-2008
I tried the above way....
it=$?
if [[ $it -eq 11 || $it -eq 31 ] ; then

But I am getting this...

line 23: syntax error in conditional expression
./CheckAutoUpTest: line 23: syntax error near unexpected token `]'
./CheckAutoUpTest: line 23: `if [[ $it -eq 11 || $it -eq 31 ] ; then'
 

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Lost Data Lost Admin

First time so excuse my ignorance please. I may not be accurately describing the issue. I have inherited a small lab mostly SUN V120s. We lost power and are trying to recover. Nope no backups... The primary issue I have is 1 box is an Oracle Server. It has 2 36Gb harddrives. I am able to... (3 Replies)
Discussion started by: murphsr
3 Replies

2. UNIX for Advanced & Expert Users

All alias in .profile lost when "script" command is called

Hi, I was trying to call "script <an ip add>" command from .profile file to log everything whenever anyone logs in to this user. I did the following at the end of .profile. 1) Extracted the IP address who logged in 2) Called script < ip add> . The problem I am facing is all, aliases etc. written... (3 Replies)
Discussion started by: amicon007
3 Replies

3. Post Here to Contact Site Administrators and Moderators

My shell pipe 2 multipipes thread is lost ?

Hi, yesterday I have got reply in my thread how to redirect shell pipe to 2 pipes. I would read that answer once again, as my re.re. is also lost Jack (6 Replies)
Discussion started by: jack2
6 Replies

4. Homework & Coursework Questions

brand new user!.. Lost on BASH script writing

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have just gotten into writing bash scripts for a class, part of the assignment is to read and be able to tell... (4 Replies)
Discussion started by: Byrang
4 Replies

5. Shell Programming and Scripting

Data pipe lost when using ssh in shell script

Hi, I want to do SSH on many different machines and then run some commands on them. A binary application randomly generates IP addresses and my script will take care of doing SSH. $ ./IPGen.exe | ./myScript.sh my script looks like this: while read line; do result1=$(ssh $line... (2 Replies)
Discussion started by: siavash
2 Replies

6. Homework & Coursework Questions

Lost in shell script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hey whats up everyone, Currently I'm stuck. In this question I have to use the following commands test, shift,... (7 Replies)
Discussion started by: AdamSahp
7 Replies

7. Shell Programming and Scripting

Why commands inside bash script lost effectiveness?

Hi, I have a bash script to run many system commands on CentOS machine, but I am puzzled by some commands had no effect on parent environment. For example, I want to refresh the desktop xdg menu when some processes added or deleted items from desktop xdg menu. If I run "killall gnome-panel"... (4 Replies)
Discussion started by: hce
4 Replies

8. Programming

Learning python, lost with script

Hi there, im just having a hard time understanding why this code does not print anything that is suppose to print: score = raw_input ('what is your score? \n') try: if 1.0 == float(score) >= 0.9: print "A" elif 0.9 > float(score) >= 0.8: ... (1 Reply)
Discussion started by: la2015
1 Replies

9. Shell Programming and Scripting

The Shell lost the inverted comma in a nested ssh command

Hi, i want use this Comand for my psql request sh ssh -o StrictHostKeyChecking=no rootatemailaddress.de sudo psql -U postgres -c "select pg_terminate_backend(pid) from pg_stat_activity where datnam=\'$DB\';"'" but the shell lost the inverted comma for datnam=\'$DB\'. The request deliver... (2 Replies)
Discussion started by: peterpane007
2 Replies
TAP::Parser::Grammar(3pm)				 Perl Programmers Reference Guide				 TAP::Parser::Grammar(3pm)

NAME
TAP::Parser::Grammar - A grammar for the Test Anything Protocol. VERSION
Version 3.23 SYNOPSIS
use TAP::Parser::Grammar; my $grammar = $self->make_grammar({ iterator => $tap_parser_iterator, parser => $tap_parser, version => 12, }); my $result = $grammar->tokenize; DESCRIPTION
"TAP::Parser::Grammar" tokenizes lines from a TAP::Parser::Iterator and constructs TAP::Parser::Result subclasses to represent the tokens. Do not attempt to use this class directly. It won't make sense. It's mainly here to ensure that we will be able to have pluggable grammars when TAP is expanded at some future date (plus, this stuff was really cluttering the parser). METHODS
Class Methods "new" my $grammar = TAP::Parser::Grammar->new({ iterator => $iterator, parser => $parser, version => $version, }); Returns TAP::Parser grammar object that will parse the TAP stream from the specified iterator. Both "iterator" and "parser" are required arguments. If "version" is not set it defaults to 12 (see "set_version" for more details). Instance Methods "set_version" $grammar->set_version(13); Tell the grammar which TAP syntax version to support. The lowest supported version is 12. Although 'TAP version' isn't valid version 12 syntax it is accepted so that higher version numbers may be parsed. "tokenize" my $token = $grammar->tokenize; This method will return a TAP::Parser::Result object representing the current line of TAP. "token_types" my @types = $grammar->token_types; Returns the different types of tokens which this grammar can parse. "syntax_for" my $syntax = $grammar->syntax_for($token_type); Returns a pre-compiled regular expression which will match a chunk of TAP corresponding to the token type. For example (not that you should really pay attention to this, "$grammar->syntax_for('comment')" will return "qr/^#(.*)/". "handler_for" my $handler = $grammar->handler_for($token_type); Returns a code reference which, when passed an appropriate line of TAP, returns the lexed token corresponding to that line. As a result, the basic TAP parsing loop looks similar to the following: my @tokens; my $grammar = TAP::Grammar->new; LINE: while ( defined( my $line = $parser->_next_chunk_of_tap ) ) { for my $type ( $grammar->token_types ) { my $syntax = $grammar->syntax_for($type); if ( $line =~ $syntax ) { my $handler = $grammar->handler_for($type); push @tokens => $grammar->$handler($line); next LINE; } } push @tokens => $grammar->_make_unknown_token($line); } TAP GRAMMAR
NOTE: This grammar is slightly out of date. There's still some discussion about it and a new one will be provided when we have things better defined. The TAP::Parser does not use a formal grammar because TAP is essentially a stream-based protocol. In fact, it's quite legal to have an infinite stream. For the same reason that we don't apply regexes to streams, we're not using a formal grammar here. Instead, we parse the TAP in lines. For purposes for forward compatibility, any result which does not match the following grammar is currently referred to as TAP::Parser::Result::Unknown. It is not a parse error. A formal grammar would look similar to the following: (* For the time being, I'm cheating on the EBNF by allowing certain terms to be defined by POSIX character classes by using the following syntax: digit ::= [:digit:] As far as I am aware, that's not valid EBNF. Sue me. I didn't know how to write "char" otherwise (Unicode issues). Suggestions welcome. *) tap ::= version? { comment | unknown } leading_plan lines | lines trailing_plan {comment} version ::= 'TAP version ' positiveInteger {positiveInteger} " " leading_plan ::= plan skip_directive? " " trailing_plan ::= plan " " plan ::= '1..' nonNegativeInteger lines ::= line {line} line ::= (comment | test | unknown | bailout ) " " test ::= status positiveInteger? description? directive? status ::= 'not '? 'ok ' description ::= (character - (digit | '#')) {character - '#'} directive ::= todo_directive | skip_directive todo_directive ::= hash_mark 'TODO' ' ' {character} skip_directive ::= hash_mark 'SKIP' ' ' {character} comment ::= hash_mark {character} hash_mark ::= '#' {' '} bailout ::= 'Bail out!' {character} unknown ::= { (character - " ") } (* POSIX character classes and other terminals *) digit ::= [:digit:] character ::= ([:print:] - " ") positiveInteger ::= ( digit - '0' ) {digit} nonNegativeInteger ::= digit {digit} SUBCLASSING
Please see "SUBCLASSING" in TAP::Parser for a subclassing overview. If you really want to subclass TAP::Parser's grammar the best thing to do is read through the code. There's no easy way of summarizing it here. SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::Iterator, TAP::Parser::Result, perl v5.16.2 2012-10-25 TAP::Parser::Grammar(3pm)
All times are GMT -4. The time now is 10:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy