Sponsored Content
Top Forums Shell Programming and Scripting perl: storing regex in array variables trouble Post 302230374 by xist on Friday 29th of August 2008 07:32:45 AM
Old 08-29-2008
in this redaction:
Code:
use strict;
use warnings;
open FILE, "/tmp/result_2";
my $regex="\\[INFO\\] Starting program ver. (.*)";
my $res='Program started, version <$1> - OK.\n';
while (<FILE>) {
if ($_ =~ /$regex/) {
   eval print $res;
    }
}
close FILE;

doesn't work as well Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

storing variables in array.Please help

Hi All, I need some help with arrays. I need to take input from the user for hostname, username and password until he enters .(dot) or any other character and store the values in the variable array. I would further connect to the hostname using username and passwd and copy files from server to... (7 Replies)
Discussion started by: nua7
7 Replies

2. Shell Programming and Scripting

Perl Array Variables to be returned to main

Hi All, I can;t seem to print out the array in sequence using the below subroutine. My first element in the array @lotsuffix is suppose to be $lotsuffix as defined in the subroutine, but when the array variable is being pass on the main program, my first element actually becomes $lotsuffix ! ... (4 Replies)
Discussion started by: Raynon
4 Replies

3. Shell Programming and Scripting

date capturing regex and storing

Hi all I need help on how to store two or more date formates captured using regex from an input sentence in PERL ? For example, I have an input sentence consisting of two dates such as : The departure date is August 12, 2009 and arrival date is 20.08.2009. Now, I want to capture the two... (4 Replies)
Discussion started by: my_Perl
4 Replies

4. UNIX for Dummies Questions & Answers

Trouble with grouping regex

Hi Forum im trying to use grouping in a regex statement in a function in a script this is the criteria im trying to match :It MUST have 3 character at the beginning. After that it can have a mix of spaces,alpha-numeric and dashes in any order eg HUG this-stuff, FGU taylor-8-shoes, ZDFnintendo... (2 Replies)
Discussion started by: ShinTec
2 Replies

5. Shell Programming and Scripting

Perl regex and sort trouble

Hi so I have these files where the first thing in them says something along the lines of "This document was accessed 'date' blah blah", I was thinking of a way to extract that date and then sort the files based on that date. My question is how do I get rid of the words in that statement so that... (6 Replies)
Discussion started by: vas28r13
6 Replies

6. Shell Programming and Scripting

Storing data in perl 2D array

Respected All, Kindly help me out. I have got file listings in a directory like this: -rw-r--r-- 1 root root 115149 2011-11-17 07:15 file1.stat.log -rw-r--r-- 1 root root 115149 2011-11-18 08:15 file2.stat.log -rw-r--r-- 1 root root 115149 2011-11-19 09:15 file3.stat.log -rw-r--r-- 1... (2 Replies)
Discussion started by: teknokid1
2 Replies

7. Shell Programming and Scripting

perl : searching for month and storing the date and time in an array

I am writing the code in perl. I have an array in perl and each variable in the array contains the data in the below format Now I need to check the below variable w.r.t system month I need to store the date and time(Tue Aug 7 03:54:12 2012) from the below data into file if contains only 'Aug'... (5 Replies)
Discussion started by: giridhar276
5 Replies

8. Shell Programming and Scripting

Storing the SQL results in array variables

Requirement 1) I need to execute 15 SQL queries in oracle through linux script. All these query results needs to be stored in array variables. Requirement 2) And these 15 queries needs to be executed in parallel. Requirement 3) Once all the queries executed then the shell script should... (3 Replies)
Discussion started by: Niranjancse
3 Replies

9. Shell Programming and Scripting

Bash 3.2 - Array / Regex - IF 3rd member in array ends in 5 digits then do somthing...

Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help. pesudo code if == ENDSINFIVEINTS ]]; then do... (4 Replies)
Discussion started by: briandanielz
4 Replies

10. Shell Programming and Scripting

Storing the Linux command output to an array in perl script

Hi I am trying to store the output of a command into an array in perl script. I am able to store but the problem is i am unable to print the array line with one line space. i mean i inserted the \n in loop ...but not getting the result. I have written like this #!/usr/bin/perl @a =... (2 Replies)
Discussion started by: kumar85shiv
2 Replies
INSTALL-INFO(1) 						   User Commands						   INSTALL-INFO(1)

NAME
install-info - update info/dir entries SYNOPSIS
install-info [OPTION]... [INFO-FILE [DIR-FILE]] DESCRIPTION
Add or remove entries in INFO-FILE from the Info directory DIR-FILE. OPTIONS
--debug report what is being done. --delete delete existing entries for INFO-FILE from DIR-FILE; don't insert any new entries. --description=TEXT the description of the entry is TEXT; used with the --name option to become synonymous with the --entry option. --dir-file=NAME specify file name of Info directory file; equivalent to using the DIR-FILE argument. --dry-run same as --test. --entry=TEXT insert TEXT as an Info directory entry. TEXT is written as an Info menu item line followed by zero or more extra lines starting with whitespace. If you specify more than one entry, all are added. If you don't specify any entries, they are determined from information in the Info file itself. When removing, TEXT specifies the entry to remove. TEXT is only removed as a last resort, if the entry as determined from the Info file is not present, and the basename of the Info file isn't found either. --help display this help and exit. --info-dir=DIR same as --dir-file=DIR/dir. --info-file=FILE specify Info file to install in the directory; equivalent to using the INFO-FILE argument. --item=TEXT same as --entry=TEXT. --keep-old do not replace entries, or remove empty sections. --menuentry=TEXT same as --name=TEXT. --name=TEXT the name of the entry is TEXT; used with --description to become synonymous with the --entry option. --no-indent do not format new entries in the DIR file. --quiet suppress warnings. --regex=R put this file's entries in all sections that match the regular expression R (ignoring case). --remove same as --delete. --remove-exactly only remove if the info file name matches exactly; suffixes such as .info and .gz are not ignored. --section=SEC put entries in section SEC of the directory. If you specify more than one section, all the entries are added in each of the sections. If you don't specify any sections, they are determined from information in the Info file itself. --section R SEC equivalent to --regex=R --section=SEC --add-once. --silent suppress warnings. --test suppress updating of DIR-FILE. --version display version information and exit. REPORTING BUGS
Email bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org. Texinfo home page: http://www.gnu.org/software/texinfo/ COPYRIGHT
Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for install-info is maintained as a Texinfo manual. If the info and install-info programs are properly installed at your site, the command info install-info should give you access to the complete manual. install-info 4.13 July 2010 INSTALL-INFO(1)
All times are GMT -4. The time now is 03:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy