Hi,
I want to do a simple loop where I have one column of text in a file and I want the loop to read each line of the file and do a simple command.
The text file will be something like this:
hostname1
hostname2
hostname3
hostname4
I am using Bash and have already come up with this to... (1 Reply)
Hi,
I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh).
The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Hello,
I have a script that runs a series of commands. Halfway through the script, I want it to check whether everything is going alright: if it is, to proceed with the script, if it isn't to repeat the last step until it gets it right.
My code so far looks like this, simplified a bit:
... (3 Replies)
This is a short program I wrote to search through a directory and move files containing the keyword to a folder.
#!/bin/bash
echo 'What is the directory?'
read DIR
echo -e '\n'
echo 'What is the keyword?'
read KEY
echo -e '\n'
cd $DIR
rmdir 'relevant_files'
mkdir 'relevant_files'... (5 Replies)
I am running the below bash loop on all the files of a specific type (highlighted in bold) in a directory. There are 4 awk commands that use the input files to search another and look for a match. The input files range from 27 - 259 and are a list of names. The file that is searched is... (11 Replies)
Hi,
In the code "for loop" has been used to search for files (command line arguments) in directories and then produce the result to the standard output. However, I want when no files are named on the command line, it should read a list of files from standard input and it should use the command... (7 Replies)
LDAP_GET_VALUES(3) Library Functions Manual LDAP_GET_VALUES(3)NAME
ldap_get_values, ldap_get_values_len, ldap_count_values - LDAP attribute value handling routines
LIBRARY
OpenLDAP LDAP (libldap, -lldap)
SYNOPSIS
#include <ldap.h>
char **ldap_get_values(ld, entry, attr)
LDAP *ld;
LDAPMessage *entry;
char *attr;
struct berval **ldap_get_values_len(ld, entry, attr)
LDAP *ld;
LDAPMessage *entry;
char *attr;
int ldap_count_values(vals)
char **vals;
int ldap_count_values_len(vals)
struct berval **vals;
void ldap_value_free(vals)
char **vals;
void ldap_value_free_len(vals)
struct berval **vals;
DESCRIPTION
These routines are used to retrieve and manipulate attribute values from an LDAP entry as returned by ldap_first_entry(3) or
ldap_next_entry(3). ldap_get_values() takes the entry and the attribute attr whose values are desired and returns a NULL-terminated array
of the attribute's values. attr may be an attribute type as returned from ldap_first_attribute(3) or ldap_next_attribute(3), or if the
attribute type is known it can simply be given.
The number of values in the array can be counted by calling ldap_count_values(). The array of values returned can be freed by calling
ldap_value_free().
If the attribute values are binary in nature, and thus not suitable to be returned as an array of char *'s, the ldap_get_values_len() rou-
tine can be used instead. It takes the same parameters as ldap_get_values(), but returns a NULL-terminated array of pointers to berval
structures, each containing the length of and a pointer to a value.
The number of values in the array can be counted by calling ldap_count_values_len(). The array of values returned can be freed by calling
ldap_value_free_len().
ERRORS
If an error occurs in ldap_get_values() or ldap_get_values_len(), NULL is returned and the ld_errno field in the ld parameter is set to
indicate the error. See ldap_error(3) for a description of possible error codes.
NOTES
These routines dynamically allocate memory which the caller must free using the supplied routines.
SEE ALSO ldap(3), ldap_first_entry(3), ldap_first_attribute(3), ldap_error(3)ACKNOWLEDGEMENTS
OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from the
University of Michigan LDAP 3.3 Release.
OpenLDAP 2017/06/01 LDAP_GET_VALUES(3)