Hello..
i want to use variable in sed..
like
sed 's/ROOTMAILID/$variable/g' conf.test
but its not working..
please help
thanks in advance
esham (2 Replies)
hi all,
i have a variable exported as
VAR=ATTRIB
then tried with,
echo "tt" | sed 's/^/$VAR/'
expected result as
ttATTRIB
but obtained only,
$VARtt
i could nt get where i am wrong.
Thanks. (3 Replies)
Hi,
Could you please explain me the below statement -- phrase wise.
sed -e :a -e '$q;N;'$cnt',$D;ba' abc.txt > xyz.txt
if suppose $cnt contains value: 10
it copies last 9 lines of abc.txt to xyz.txt
why it is copying last 9 rather than 10.
and also what is ba and $D over there in... (4 Replies)
This is my first post so hi to you all. I have browsed these forums in the past and what a great community and resource this is! Thanks to all the contributors ... I look forward to being able to give something back.
In the meantime, I have a little conundrum concerning sed. My very simple... (6 Replies)
Hi,
i need find and replace a sting with a new variable having value as spaces in between.
Eg:
set a = "i am variable"
set b = "i am second"
sed -e 's/find_string/'$a'/g' -e 's/find2_str/'$b'/g' input_file
here it is giving error...
How to get an varaible, which is... (6 Replies)
Hi Friends,
I am trying to modify a script .The script contains this line:
sed -n -e 's_.*>\(.*\)<.*_\1_p' filename.xml
I am not great in sed command.I know, it is regular expression
to match a pattern string that starts with s_ and ends with 1_.I doesnot give the desired result.
Can... (4 Replies)
sed '$!N; /^\(.*\)\n\1$/!P; D'
i found this file which removes duplicates irrespective for sorted or unsorted file. keep first occurance and remove the further occurances.
can any1 explain how this is working..
i need to remove duplicates following file. duplicate criteria is not the... (3 Replies)
Hi All
Can some one explain what does the given two sed commands do :confused:
sed "s/\'/\\\'/g" |
sed 's/\"/\\\"/g'
Please find the sample code i used to find out what this is doing , but it has confused me more :wall:
$ cat sri1.txt
\
'
"
$ sed 's/\"/\\\"/g' sri1.txt
\
'... (5 Replies)
Will someone give me an explanation on how the sed command below works.
sed 's/.*//'
Thanks! (3 Replies)
Discussion started by: scj2012
3 Replies
LEARN ABOUT DEBIAN
typetrait
FBB::TypeTrait(3bobcat) Error handler FBB::TypeTrait(3bobcat)NAME
FBB::TypeTrait - shortdesc
SYNOPSIS
#include <bobcat/typetrait>
DESCRIPTION
FBB::TypeTrait is a traits class. It does not define any member functions or data members, but merely types. It can be used to determine
the basic type and other characteristics of (const) plain, (const) pointer or (const) reference types. It was designed after Alexandrescu's(2001) TypeTraits template class.
The FBB::LpromotesR class template is used to determine, compile-time, whether its second (right-hand side) template type can be promoted
to its first (left-hand side) template type.
The FBB::Use class template expects two typenames LHS and RHS and defines typename Use<LHS, RHS>::type as LHS if RHS can be promoted to LHS
or it defines typename Use<LHS, RHS>::type as RHS.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM -
TypeTrait<TYPE>
TYPE is the template type parameter whose characteristics must be determined.
TypeTrait<TYPE> defines the type Plain: the plain type (the type without const, pointer, reference type indication) of any const or
non-const plain, pointer, lvalue- or rvalue-reference type.
TypeTrait<TYPE> defines the following bool values:
o isClass: true if the template type argument represents a class (struct) type, false otherwise.
o isConst: true if the template type argument represents a const type, false otherwise.
o isPointer: true if the template type argument represents a pointer type, false otherwise.
o isR_Ref: true if the template type argument represents a rvalue reference type, false otherwise.
o isRef: true if the template type argument represents an lvalue reference type, false otherwise.
LpromotesR<LeftType, RightType>
LpromotesR<LeftType, RightType> defines the enum constant yes as 1 if an RightType argument can be promoted to LeftType value or object.
The enum value yes is defined as 0 if no such constructor is available or if such a constructor is defined using the explicit keyword.
EXAMPLES
Here is an example using LpromotesR:
int main()
{
cout << "string promotes char const *: " <<
LpromotesR<string, char const *>::yes << '
'; // 1
cout << "string promotes string " <<
LpromotesR<string, string>::yes << '
'; // 1
cout << "char const * promotes string " <<
LpromotesR<char const *, string>::yes << '
'; // 0
}
FILES
bobcat/typetrait - defines the class interface
SEE ALSO bobcat(7)
Alexandrescu A.(2001) Modern C++ Design, Addison-Wesley, Boston.
BUGS
None Reported.
DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature;
o bobcat_3.01.00-x.tar.gz: source archive;
o bobcat_3.01.00-x_i386.changes: change log;
o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;
BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL).
AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl).
libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::TypeTrait(3bobcat)