01-30-2014
thanks a lot ravinder..for the below command:
awk '/lcpu/ {print $(NF-2)}' vmstat_output
this command is based on the number of fileds and it may be possible that we can have n number of fileds in the output of vmstat.
so can you please help me in making the search pattern more specific,rather than just searching for 'lcpu' , can we try to search for lcpu=<numerica value> and the print should be irrespective of the number of field , that is the output of search should only be lcpu=4 and not the other fileds like 'System configuration:mem=5376MB ent=1.00'
please suggest.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Can someone please help me write a script for the following requirement in awk, grep, sed or perl.
Buuuu xxx bbb
Kmmmm rrr ssss uuuu
Kwwww zzzz ccc
Roooowwww eeee
Bxxxx jjjj dddd
Kuuuu eeeee nnnn
Rpppp cccc vvvv cccc
Rhhhhhhyyyy tttt
Lhhhh rrrrrssssss
Bffff mmmm iiiii
Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I'm trying to create a program in perl called myfind.pl;
To use the program:
(at the command line)$ program.pl keyword filename
note: the keyword is any word or regular expression
and it should display the result just like when you 'cat' the file name but with the keyword in... (2 Replies)
Discussion started by: Horizon666
2 Replies
3. Shell Programming and Scripting
Hi,
Please take a look at the below eg. I would like to search for abc() pattern first and then search for (xyz) in the next line. If I can find the pattern, then I should delete the 3 lines.
I can only find the pattern and delete but I am unable to find two patterns and delete. Any... (8 Replies)
Discussion started by: sreedevi
8 Replies
4. Shell Programming and Scripting
Hi,
Below is my input file:
Data: 1
Length: 20
Got result.
Data: 2
Length: 30
No result.
Data: 3
Length: 20 (7 Replies)
Discussion started by: edge_diners
7 Replies
5. Shell Programming and Scripting
I am trying to find a way to utilise the full potential of my cpu cores and memory on my windows machine.
Now, I am quite familiar with grep, however, running a Unix based OS is not an option right now.
Unfortunately, the 32 bit grep for windows that I am running, I cannot run multiple... (1 Reply)
Discussion started by: Moloch
1 Replies
6. Shell Programming and Scripting
Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period.
Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Discussion started by: right_coaster
10 Replies
7. Shell Programming and Scripting
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Discussion started by: dani777
9 Replies
8. Shell Programming and Scripting
Hi all,
i am trying to count the number of logical processors from the below output:
# print_manifest | grep "logical processors"
8 cores, 16 logical processors per socket
2 logical processors (2 per socket)
i just want to have below output :
16
2
also... (11 Replies)
Discussion started by: omkar.jadhav
11 Replies
9. Shell Programming and Scripting
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies
10. Shell Programming and Scripting
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
LEARN ABOUT REDHAT
ud.conf
UD.CONF(5) File Formats Manual UD.CONF(5)
NAME
ud.conf - ud configuration file
SYNOPSIS
/etc/openldap/ud.conf
DESCRIPTION
The ud configuration file is used to set system-wide defaults to be applied when running ud. Note that each user may specify an optional
configuration file, .udrc, in his/her home directory which will be used instead of the system-wide configuration file.
OPTIONS
The different configuration options are:
HOST <name>
Used to specify the name of an LDAP server to which ud should connect. There may be only one entry per config file. The
server's name can be specified as a domain-style name or an IP address.
BASE <base>
Used to specify the search base to use when performing search operations. The base may be changed by those using ud by using the
cb command. There may be only one entry per config file. The base must be specified as a Distinguished Name in LDAP format.
GROUPBASE <base>
Used to specify the base used when creating groups. The base may be changed by those using ud by using the changegroup command.
There may be only one entry per config file. The base must be specified as a Distinguished Name in LDAP format.
SEARCH <algorithm>
Used to specify a search algorithm to use when performing searches. More than one algorithm may be specified, and each is tried
in turn until a suitable response is found.
Each algorithm specifies a filter that should be used when performing a find operation. Filters contain LDAP-style attribute
types (e.g., uid, cn, postalAddress) and operators to test for equality or approximate equality. Prefix operators may also be
used to specify AND, OR and NOT operations (see ldap(3) for more details on the filter format). Algorithms use a compile-time
constant as a separator to use when parsing the input the user has provided. This parsed input can then be referenced similarly
to an awk program using symbols like $1, $2, and $0 for the entire batch of input.
For example, the algoritm cn=$0 causes ud to perform a lookup on the entire string the user has typed, searching for anything
where the commonName exactly matches the whole thing.
Another example, sn~=$NF causes ud to do a search where the last element the user has typed (NF = number of fields and is a spe-
cial "number" that can be used in awk as well as ud) searching for any matches that approximately match Surname.
Search algorithms also support a special feature which allows one to specify the exact number of fields that must be present in
order for the algorithm to be applied. This number must be specified between square brackets.
For example, [1] uid=$1 causes this algorithm to be applied when the number of fields is exactly equal to one. If there is
exactly one field, the token is looked up as a UID.
FILES
/etc/openldap/ud.conf
SEE ALSO
ud(1), ldap(3)
AUTHOR
Bryan Beecher, University of Michigan
ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan
LDAP 3.3 Release.
4.3 Berkeley Distribution 20 August 2000 UD.CONF(5)