10-15-2013
What do you consider "much larger"? A hundred lines? A thousand? A million? A billion? A simple solution may scale from 12 to 1000, but perhaps not to a million and beyond.
It would be a shame for someone to waste their time crafting code that can never be used because it takes forever to complete or because it requires more memory than the system has available. So, please, be more precise than "much larger". Also, if the file can approach the size of your system's memory, you should definitely mention that.
Regards,
Alister
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies
2. Shell Programming and Scripting
HELLO ALL,
URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE.
FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY
and the CITY column records will be: Newyork
washington
... (1 Reply)
Discussion started by: abhilash mn
1 Replies
3. SCO
Hi Gurus,
I had a question regarding avoiding duplicates.i have a file abc.txt
abc.txt
-------
READER_1_1_1> HIER_28056 XML Reader: Error occurred while parsing:; line number ; column number
READER_1_3_1> Sun Mar 23 23:52:48 2008
READER_1_3_1> HIER_28056 XML Reader: Error occurred while... (0 Replies)
Discussion started by: pssandeep
0 Replies
4. Shell Programming and Scripting
Hi all,
i have a data array as followes.
ARRAY=DFSG345GGG
ARRAY=234FDFG090
ARRAY=VDFVGBGHH
so on..........
i need all english letters to be change to lower case. So i am expecting to see
ARRAY=dfsg345ggg
ARRAY=234fdfg090
ARRAY=vdfvgbghh
so on........
If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies
5. Shell Programming and Scripting
Hi
I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute":
original becomes substitute
Origninal becomes Substitute
ORIGINAL becomes SUBSTITUTE
I know this a little special but it's not... (1 Reply)
Discussion started by: kmchen
1 Replies
6. Shell Programming and Scripting
Hello Unix Gurus :
It would be really appreciative if can find a solution for this .
I have records in a file .
I need to Capitalize the records based on condition .
For Example i tried the following Command
COMMAND -->
fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Discussion started by: tsbiju
12 Replies
7. Shell Programming and Scripting
Hello All,
I have code as follows :-
while true do
{opening a case1 statement}
1)
{opening another case2 statement}
{closing case 2}
2)
Showing error for "2)" as Syntax error at line 59 : `)' is not expected.
*)
{closing case 1}
... (5 Replies)
Discussion started by: Renjesh
5 Replies
8. Shell Programming and Scripting
complinagetest () #function name
{
if ;then
rm complins.dat
fi
touch complins.dat
i=0
while read line
do
if ; then
va=`grep -w "$line" datalins1.dat | awk BEGIN'{FS="\`~"}{if ( $3=="'$line'" ) {print $4}}'`
i=$(($i+1))
varits=$(echo $va|awk -v varif="$i" '{print... (1 Reply)
Discussion started by: amitpaul01
1 Replies
9. Shell Programming and Scripting
Hi all,
I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like
. ; : ! ?I found the following command
sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Discussion started by: georgi58
7 Replies
LEARN ABOUT LINUX
memguard
MEMGUARD(9) BSD Kernel Developer's Manual MEMGUARD(9)
NAME
MemGuard -- memory allocator for debugging purposes
SYNOPSIS
options DEBUG_MEMGUARD
DESCRIPTION
MemGuard is a simple and small replacement memory allocator designed to help detect tamper-after-free scenarios. These problems are more and
more common and likely with multithreaded kernels where race conditions are more prevalent.
Currently, MemGuard can take over malloc(), realloc() and free() for a single malloc type. MemGuard can also guard all allocations larger
than PAGE_SIZE, and can guard a random fraction of all allocations. There is also a knob to prevent allocations smaller than a specified
size from being guarded, to limit memory waste.
EXAMPLES
To use MemGuard for a memory type, either add an entry to /boot/loader.conf:
vm.memguard.desc=<memory_type>
Or set the vm.memguard.desc sysctl(8) variable at run-time:
sysctl vm.memguard.desc=<memory_type>
Where memory_type is a short description of the memory type to monitor. Only allocations from that memory_type made after vm.memguard.desc
is set will potentially be guarded. If vm.memguard.desc is modified at run-time then only allocations of the new memory_type will poten-
tially be guarded once the sysctl(8) is set. Existing guarded allocations will still be properly released by free(9).
The short description of a malloc(9) type is the second argument to MALLOC_DEFINE(9), so one has to find it in the kernel source.
The vm.memguard.divisor boot-time tunable is used to scale how much of the system's physical memory MemGuard is allowed to consume. The
default is 10, so up to cnt.v_page_count/10 pages can be used. MemGuard will reserve vm_kmem_max / vm.memguard.divisor bytes of virtual
address space, limited by twice the physical memory size. The physical limit is reported as vm.memguard.phys_limit and the virtual space
reserved for MemGuard is reported as vm.memguard.mapsize.
MemGuard will not do page promotions for any allocation smaller than vm.memguard.minsize bytes. The default is 0, meaning all allocations
can potentially be guarded. MemGuard can guard sufficiently large allocations randomly, with average frequency of every one in 100000 /
vm.memguard.frequency allocations. The default is 0, meaning no allocations are randomly guarded.
MemGuard can optionally add unmapped guard pages around each allocation to detect overflow and underflow, if vm.memguard.options has the 1
bit set. This option is enabled by default. MemGuard will optionally guard all allocations of PAGE_SIZE or larger if vm.memguard.options
has the 2 bit set. This option is off by default.
SEE ALSO
sysctl(8), vmstat(8), contigmalloc(9), malloc(9), redzone(9)
HISTORY
MemGuard first appeared in FreeBSD 6.0.
AUTHORS
MemGuard was originally written by Bosko Milekic <bmilekic@FreeBSD.org>. This manual page was originally written by Christian Brueffer
<brueffer@FreeBSD.org>. Additions have been made by Matthew Fleming <mdf@FreeBSD.org> to both the implementation and the documentation.
BUGS
Currently, it is not possible to override UMA zone(9) allocations.
BSD
August 2, 2010 BSD