01-23-2009
Where do you want these variables to be recorded?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Under IRIX 6.5, the Bourne shell is named /bin/bsh. I need to redirect output into a file reading loop, and retain values set within the loop based on processing that goes on within the loop for later processing. This code
#!/bin/bsh
k=1
cat file | while read k ; do
echo "$k"
done... (2 Replies)
Discussion started by: criglerj
2 Replies
2. Shell Programming and Scripting
Hey guys,
We are going to be receiving files containing header information. This will be 1 line of code in each file containing the following format:
20050719hhmmsssfgr00310000537000000000000000
My question is...How can I pull parts of the header info and set it to vars in my shell. I... (4 Replies)
Discussion started by: ecupirate1998
4 Replies
3. Shell Programming and Scripting
Hi guys,
i have a problem which im hoping you will be able to help me with.
I have follwing output :-
-------------------------------------------------------------------------------
NSTEP = 407000 TIME(PS) = 43059.000 TEMP(K) = 288.46 PRESS = 0.0
Etot = -2077.4322 ... (2 Replies)
Discussion started by: Mish_99
2 Replies
4. Shell Programming and Scripting
i have a file a.txt and following is only one portion.
I want to search <branch value="/dev36/AREA/" include="yes"></branch> present in between
<template_file name="Approve External" path="core/approve/bin" and </template_file>
where the no of lines containing "<branch value= " is increasing ... (2 Replies)
Discussion started by: millan
2 Replies
5. Shell Programming and Scripting
Hi,
I have a string as
str="route net,-hopcount,1,255.255.255.0,10.230.20.111,10.230.20.234 Route True route net,-hopcount,0,-netmask,255.255.248.0,0,10.230.23.254 Route True"
I need to split this string into two lines as
route net,-hopcount,1,255.255.255.0,10.230.20.111,10.230.20.234... (4 Replies)
Discussion started by: chaitanyapn
4 Replies
6. UNIX for Advanced & Expert Users
Hello everyone,
I am curious to find a possible way of doing something like this in ksh:
call a function and have that function set the value of the variable that the function knows by the name of $1....
example:
#! /bin/ksh
set_var(){
case $1 in
var1) this is where I would like to... (7 Replies)
Discussion started by: gio001
7 Replies
7. Shell Programming and Scripting
I have a shell script I want to run that will set environment variables based on the value of an input variable submitted when the shell script is called. For example:
$ mgenv.sh prod
This would set environment variables for prod
$ mgenv.sh test
This would set environment variables... (1 Reply)
Discussion started by: brtaylor73
1 Replies
8. UNIX for Dummies Questions & Answers
i have something like this
abc 123 3234 1234 * qqoiki * abc 4533 34 1234 * lloiki *
i want to make it two lines i,e.,abc 123 3234 1234 * qqoiki *
abc 4533 34 1234 * lloiki * how to do that ? (13 Replies)
Discussion started by: anurupa777
13 Replies
9. Shell Programming and Scripting
Hi All,
Am very new for this Shell scripting.
Could anyone pls let me know how to delete a set of lines from a (.DAT) file using ksh script.
for example from line 3 to line 7. The size of the target file is huge:(
---------- Post updated at 11:01 PM ---------- Previous update was at 11:00 PM... (5 Replies)
Discussion started by: kasthu12
5 Replies
10. UNIX for Dummies Questions & Answers
Hi,
How do i remove a set of duplicate lines from a file.
My file contains the lines:
abc
def
ghi
abc
def
ghi
jkl
mno
pqr
jkl
mno (1 Reply)
Discussion started by: raosr020
1 Replies
LEARN ABOUT CENTOS
malloc_set_state
MALLOC_GET_STATE(3) Linux Programmer's Manual MALLOC_GET_STATE(3)
NAME
malloc_get_state, malloc_set_state - record and restore state of malloc implementation
SYNOPSIS
#include <stdlib.h>
void* malloc_get_state(void);
int malloc_set_state(void *state);
DESCRIPTION
The malloc_get_state() function records the current state of all malloc(3) internal bookkeeping variables (but not the actual contents of
the heap or the state of malloc_hook(3) functions pointers). The state is recorded in a system-dependent opaque data structure dynamically
allocated via malloc(3), and a pointer to that data structure is returned as the function result. (It is the caller's responsibility to
free(3) this memory.)
The malloc_set_state() function restores the state of all malloc(3) internal bookkeeping variables to the values recorded in the opaque
data structure pointed to by state.
RETURN VALUE
On success, malloc_get_state() returns a pointer to a newly allocated opaque data structure. On error (for example, memory could not be
allocated for the data structure), malloc_get_state() returns NULL.
On success, malloc_set_state() returns 0. If the implementation detects that state does not point to a correctly formed data structure,
malloc_set_state() returns -1. If the implementation detects that the version of the data structure referred to by state is a more recent
version than this implementation knows about, malloc_set_state() returns -2.
CONFORMING TO
These functions are GNU extensions.
NOTES
These functions are especially useful when using this malloc(3) implementation as part of a shared library, and the heap contents are
saved/restored via some other method. This technique is used by the GNU Emacs to implement its "dumping" function.
Hook function pointers are never saved or restored by these functions, with two exceptions: if malloc checking (see mallopt(3)) was in use
when malloc_get_state() was called, then malloc_set_state() resets malloc checking hooks if possible; if malloc checking was not in use in
the recorded state, but the caller has requested malloc checking, then the hooks are reset to 0.
SEE ALSO
malloc(3), mallopt(3)
COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU
2012-05-04 MALLOC_GET_STATE(3)