I need to have an if statement in a script to run if there are certain processes running. Easiest way I can see to do this is to run a ps and grep the results based on what I am looking for:
$ ps -ef | grep wtrs
---
webtrend 5046 1 0 May 12 ? 0:28 /webtrends/versions/6.1/wtrs_ui... (6 Replies)
Looking for awk statement that will match all lines starting with "# "
if ( $1 == \^"#" )
Input file:
# of the server. If you would like to set these, please take out the
# pound (#) sign in front of one or all severities and set it equal to
# severity desired. For example, FATAL=3
#... (2 Replies)
Hi ,
I have a huge file like this
=245 this is testing
=035 abc123
=245 this is testing1
=035 abc124
=245 this is testing2
=035 abc125
=035 abc126
=245 this is testing3
here i have to pull out those lines having two =035 instead of alternative 035 and 245 i.e extract... (18 Replies)
Hi guys,
I usualy am able to google awk stuff but I can't find it so far and there are so many awking gurus here that I will give it a shot.
I want to print $1;$3;"$5 up to the $NF". In other words, I can have 1000 colums, but need to have $5 up to the end.
I started with the idea of... (2 Replies)
I have a file that looks like this:
John Smith
http://www.profile1.com
http://www.profile2.com
http://www.profile3.com
Marc Olsen
http://www.profile4.com
http://www.profile5.com
http://www.profile6.com
http://www.profile7.com
Lynne Doe
http://www.profile8.com
http://www.profile9.com... (3 Replies)
Dear All,
I would like to compare two files and return the number of matches found.
Example
File A
Lx2
L1_Mus1
L1Md_T
Lx5
L1M2
L1_Mus3
Lx3_Mus
Lx9
Lx2A
L1Md_A
L1Md_F2
File B
L1_Mus3
L1_Mus3 (3 Replies)
Here is the task that I was presented with:
I am dealing with about a 10,000 line input deck file for an analysis. About 10 separate blocks of around 25 lines of code each need to be updated in the input deck.
The input deck (deckToChange in the code below) comes with 2 separate files. File 1... (5 Replies)
Hello
I have a large file1 which has many events like "2014010420" and following lines under each event that start with text . It has this form:
2014010420 num --- --- num ....
NTE num num --- num...
EFA num num --- num ...
LASW num num --- num... (9 Replies)
Hi all!
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Example:
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
Discussion started by: demmel
8 Replies
LEARN ABOUT DEBIAN
alloc_unrl
ALLOC_UNR(9) BSD Kernel Developer's Manual ALLOC_UNR(9)NAME
new_unrhdr, delete_unrhdr, alloc_unr, free_unr -- kernel unit number allocator
SYNOPSIS
#include <sys/systm.h>
struct unrhdr *
new_unrhdr(int low, int high, struct mtx *mutex);
void
delete_unrhdr(struct unrhdr *uh);
int
alloc_unr(struct unrhdr *uh);
int
alloc_unrl(struct unrhdr *uh);
void
free_unr(struct unrhdr *uh, u_int item);
DESCRIPTION
The kernel unit number allocator is a generic facility, which allows to allocate unit numbers within a specified range.
new_unrhdr(low, high, mutex)
Initialize a new unit number allocator entity. The low and high arguments specify minimum and maximum number of unit numbers. There
is no cost associated with the range of unit numbers, so unless the resource really is finite, INT_MAX can be used. If mutex is not
NULL, it is used for locking when allocating and freeing units. Otherwise, internal mutex is used.
delete_unrhdr(uh)
Destroy specified unit number allocator entity.
alloc_unr(uh)
Return a new unit number. The lowest free number is always allocated. This function does not allocate memory and never sleeps, how-
ever it may block on a mutex. If no free unit numbers are left, -1 is returned.
alloc_unrl(uh)
Same as alloc_unr() except that mutex is assumed to be already locked and thus is not used.
free_unr(uh, item)
Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked
variant.
CODE REFERENCES
The above functions are implemented in sys/kern/subr_unit.c.
HISTORY
Kernel unit number allocator first appeared in FreeBSD 6.0.
AUTHORS
Kernel unit number allocator was written by Poul-Henning Kamp. This manpage was written by Gleb Smirnoff.
BSD February 7, 2010 BSD