i am very new to UNIX
plz help me in this scenario
i have two text files as below
file1.txt
name=Rajakumar.
Discipline=Electronics and communication.
Designation=software Engineer.
file2.txt
name=Kannan.
Discipline=Mechanical.
Designation=CADD Design Engineer.
... (6 Replies)
Hi,
I have a file with the following contents
# Lines that start with a # are comments.
#
# Calling TOAD like this will perform a comparison from command line :
#
# "C:\Program Files\Quest Software\Toad for Oracle 9.6\toad.exe" -c... (2 Replies)
Hi -
I am looking for a replacing a string in a in multiple *.sql files in directory with a new string without using a temporary file
Normally I can use sed command as below
for W in ls `FILE*.sql`
do
sed 's/OLD/NEW/g' $W > TEMPFILE.dat
mv TEMPFILE.dat $W
done
But Here in my... (9 Replies)
Hi Everyone,
I am new to this forum and new to sed/awk programming too !!
I need to find particular string in file1(text file) and replace it with a value from another text file(file2) the file2 has only one line and the value to be replaced with is in the second column.
file 1:
(assert (=... (21 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
We have two files
file 1: (usually small, ~100 lines), each line contains a : separated index, value e.g
2: Apple
1: Banana
5: Pear
7: Orange
File 2: (usually large, 10 million lines or more), each line contains a single string value. e.g
xyz1
xyz2
xyz3
xyz4
xyz5
xyz6
xyz7
Now... (2 Replies)
Hello Forum.
I have a file called abc.sed with the following commands;
s/1/one/g
s/2/two/g
...
I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat
sed -f abc.sed abc.dat >... (10 Replies)
Hi
I have a large txt file on my AIX server and I need to replace some text using two other files. So filename1 has about 500 lines similar to:
txtcode SYStem100
I have the string I want to change in string2 and the new stringname in string3. Does anyone know a way of doing this? I have... (1 Reply)
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
LEARN ABOUT CENTOS
libtalloc_stealing
libtalloc_stealing(3) talloc libtalloc_stealing(3)NAME
libtalloc_stealing - Chapter 2: Stealing a context
Stealing a context
Talloc has the ability to change the parent of a talloc context to another one. This operation is commonly referred to as stealing and it
is one of the most important actions performed with talloc contexts.
Stealing a context is necessary if we want the pointer to outlive the context it is created on. This has many possible use cases, for
instance stealing a result of a database search to an in-memory cache context, changing the parent of a field of a generic structure to a
more specific one or vice-versa. The most common scenario, at least in Samba, is to steal output data from a function-specific context to
the output context given as an argument of that function.
struct foo {
char *a1;
char *a2;
char *a3;
};
struct bar {
char *wurst;
struct foo *foo;
};
struct foo *foo = talloc_zero(ctx, struct foo);
foo->a1 = talloc_strdup(foo, "a1");
foo->a2 = talloc_strdup(foo, "a2");
foo->a3 = talloc_strdup(foo, "a3");
struct bar *bar = talloc_zero(NULL, struct bar);
/* change parent of foo from ctx to bar */
bar->foo = talloc_steal(bar, foo);
/* or do the same but assign foo = NULL */
bar->foo = talloc_move(bar, &foo);
The talloc_move() function is similar to the talloc_steal() function but additionally sets the source pointer to NULL.
In general, the source pointer itself is not changed (it only replaces the parent in the meta data). But the common usage is that the
result is assigned to another variable, thus further accessing the pointer from the original variable should be avoided unless it is
necessary. In this case talloc_move() is the preferred way of stealing a context. Additionally sets the source pointer to NULL,
thus.protects the pointer from being accidentally freed and accessed using the old variable after its parent has been changed.
Version 2.0 Tue Jun 17 2014 libtalloc_stealing(3)