Sponsored Content
Full Discussion: variable joining
Top Forums Shell Programming and Scripting variable joining Post 302402252 by hezry79 on Tuesday 9th of March 2010 08:42:22 AM
Old 03-09-2010
i already ammend it but below is the error:

Code:
recoverwebload: line 19: syntax error in conditional expression: unexpected token `;'
recoverwebload: line 19: syntax error near `;t'
recoverwebload: line 19: `if  [[ $VAR1 -gt $max_loadavg || $VAR2 -gt $max_loadavg]];then'


Last edited by Scott; 03-09-2010 at 04:02 PM.. Reason: Added code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

joining files

Hi, Could anyone help me ? I'm trying to join two files, but no common field are on them. So I think on generate \000\ sequence to add for each line on both files, so then will be able to join these files. Any idea? Thanks in advance, (2 Replies)
Discussion started by: Manu
2 Replies

2. Shell Programming and Scripting

Help with joining two files

Greetings, all. I've got a project that requires I join two data files together, then do some processing and output. Everything must be done in a shell script, using standard unix tools. The files look like the following: File_1 Layout: Acct#,Subacct#,Descrip Sample: ... (3 Replies)
Discussion started by: rjlohman
3 Replies

3. UNIX for Dummies Questions & Answers

joining variable to the end of a file name

hi all i have a directory which contain file 20060101-66666-09-08-0.tif 20060101-77777-11-12-0.tif 20051231-54221-66-55.tif 20051231-54221-66-44.tif as you can see the name of the two last files is shorter then the first ones i want to take all the files with the shorter name and to add to... (7 Replies)
Discussion started by: naamas03
7 Replies

4. Shell Programming and Scripting

Joining two arrays and then creating a variable

Hello all... I'd like to create a variable from an array element from two arrays. In my search for answers I found this code for bash that joins two arrays and then started to work with it. I had got to work once and then foolishly without saving the code, I started to edit it for ksh and... (4 Replies)
Discussion started by: carlos25
4 Replies

5. Shell Programming and Scripting

joining two lines

Hi , I want to join two lines in a file, where the second line contain query string. if it doesn't contain that string i don't want to join e.g. Input file is as following: name fame game none none none name fame game cat eat mice I need output file as name fame game none none... (2 Replies)
Discussion started by: ashrafonics
2 Replies

6. Shell Programming and Scripting

Need help joining lines

Hi All, I need the command to join 2 lines into one. I found lots of threads but none give me the sollution. Probably because unix scripting is one of my best features ;) I got a logfile where line 2 needs to be joined with line 1, lines 4 needs to be joined with line 3 etc If you need... (16 Replies)
Discussion started by: rene21976
16 Replies

7. Shell Programming and Scripting

Joining two files into one

Hi experts, I'm quite newbie here!! I have two seperate files. Contents of file like below File 1: 6213019212001 8063737 File:2 15703784 I want to join these two files into one where content will be File 3: 6213019212001 8063737 15703784 Regards, Ray Seilden (1 Reply)
Discussion started by: RayanS
1 Replies

8. Shell Programming and Scripting

Joining

I do have many files of the following format. File_1.txt 1 24 2 25 3 27 4 28 5 29 6 1 File_2.txt 2 5 3 8 4 9 5 10 File_3.txt (3 Replies)
Discussion started by: Lucky Ali
3 Replies

9. Shell Programming and Scripting

Joining lines in different way

Hi all, I'm excited to the part of unix.com forum, and noob to it. I have an query, where I have an file and it contains data like this use thread when posting do no I was expecting the result as use thread thread when when posting posting do do no use thread when thread when... (6 Replies)
Discussion started by: Jose Nirmal
6 Replies

10. Shell Programming and Scripting

Please help me in joining two files

I have two files with the below contents : sampleoutput3.txt 20150202;hostname1 20150223;hostname2 20150716;hostname3 sampleoutput1.txt hostname;packages_out_of_date;errata_out_of_date; hostname1;11;0; hostnamea;12;0; hostnameb;11;0; hostnamec;95;38; hostnamed;440;358;... (2 Replies)
Discussion started by: rahul2662
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 05:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy