Hi All
I want to search a string from an array in Perl. If a match occurs, assign that string to a variable else assign 'No match'. I tried writing the script as follows but it's in vain. Please help me..
#!/usr/bin/perl
use strict;
my $NER;
my @text=("ORG","PER");
... (4 Replies)
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
Hi,
I am just writing a program to check a value in the given array.
The program expects a parameter which is checked against the array list and if it found then a variable is set else should exist saying the value does is not found in the array.kindly help me. (4 Replies)
Hi,
I am using KSH shell to do some programming.
I want to search array and print index value of the array.
Example..
nodeval4workflow="DESCRIPTION ="" ISENABLED ="YES" ISVALID ="YES" NAME="TESTVALIDATION"
set -A strwfVar $nodeval4workflow
strwfVar=DESCRIPTION=""... (1 Reply)
I am wanting to take a list of strings and loop through a list of textfiles to find matches. Preferably with awk and parsing the search strings into an array.
// Search_strings.txt
tag
string
dummy
stuff
things
// List of files to search in
textfile1.txt
textfile2.txt
The... (6 Replies)
I have a file search_strings.txt filled with search strings which have a blank in between and look like this:
S. g. Erh.
o. J.
v. d. Chijs
g. Ehr.I would like to search the strings in the second given Textfile.txt and it shall return the column number.
Can anybody help with the correct... (3 Replies)
Hi all,
In bash, is there any way of searching an array and returning the index?
For example, how could I write a script that would do the following:
>> search note_array=(C D E F G A B) for F
return the value 3 (or 4)
Thanks,
R (5 Replies)
hi i have two data sets one(data1) containing
3
8 2 1 5 7 9
9 2 2 5 7 7
10 3 6 6 6 6
and other(data2) containing
5
1 10
5 20
7 30
6 40
9 50
now i want my program to search the values 1 5 7 9 from (data1) in data 2 column 1 and then take the average of the corresoinding... (1 Reply)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Hi,
i want to search and replace array values by using perl
perl -pi -e "s/${d$i]}/${b$j]}" *.xml
i am using while loop for the same. if i excute this,it shows "Substitution replacement not terminated at -e line 1.".
please tell me what's wrong this line (1 Reply)
Discussion started by: arindam guha
1 Replies
LEARN ABOUT REDHAT
mkdtemp
MKDTEMP(3) Linux Programmer's Manual MKDTEMP(3)NAME
mkdtemp - create a unique temporary directory
SYNOPSIS
#include <stdlib.h>
char *mkdtemp(char *template);
DESCRIPTION
The mkdtemp() function generates a uniquely-named temporary directory from template. The last six characters of template must be XXXXXX and
these are replaced with a string that makes the directory name unique. The directory is then created with permissions 0700. Since it will
be modified, template must not be a string constant, but should be declared as a character array.
RETURN VALUE
The mkdtemp() function returns a pointer to the modified template string on success, and NULL on failure, in which case errno is set appro-
priately.
ERRORS
EINVAL The last six characters of template were not XXXXXX. Now template is unchanged.
Also see mkdir(2) for other possible values for errno.
CONFORMING TO
Introduced in OpenBSD 2.2. Available since glibc 2.1.91.
SEE ALSO mkdir(2), mkstemp(3), mktemp(3), tmpnam(3), tempnam(3), tmpfile(3)GNU 2001-10-07 MKDTEMP(3)