08-13-2019
Hi MadeinGermany,
Thanks for the tips.
The first solution does not work,
Code :
./copy_chroot_lib.sh ls echo | sed -n 's#\(/lib\).*#\1#p'
libselinux.so.1 => /lib
libc.so.6 => /lib
libpcre.so.3 => /lib
libdl.so.2 => /lib
/lib
libpthread.so.0 => /lib
libc.so.6 => /lib
/lib
While the output from the second solution does not capture only file path, and also captures (0x00...)
Code :
./copy_chroot_lib.sh ls echo | sed -n 's#.* => ##p'
/lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f73bfead000)
/lib/x86_64-linux-gnu/libc.so.6 (0x00007f73bfcc3000)
/lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f73bfc4f000)
/lib/x86_64-linux-gnu/libdl.so.2 (0x00007f73bfc49000)
/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f73bfc28000)
/lib/x86_64-linux-gnu/libc.so.6 (0x00007f2cfa01c000)
I suppose we can exclude the hex value via the following, then capture lines starting with /lib.
Code :
./copy_chroot_lib.sh ls echo | sed -E 's#.* => ##;s/[(]0.*//'
linux-vdso.so.1 <----- should not be included
/lib/x86_64-linux-gnu/libselinux.so.1
/lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libpcre.so.3
/lib/x86_64-linux-gnu/libdl.so.2
/lib64/ld-linux-x86-64.so.2
/lib/x86_64-linux-gnu/libpthread.so.0
linux-vdso.so.1
/lib/x86_64-linux-gnu/libc.so.6
/lib64/ld-linux-x86-64.so.2
Do let me know if you have any better ideas.
Thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to extract "securitySettings" out of line:
<a ref ="http://localhost:5654/securitySettings">
using sed as follows:
name = `grep "localhost" file.html | sed -n 's/.**\/\(.*)/\">/\1/p'`
But it didn't run, seems have some syntax error. Do anybody knows why?
Thank you very... (11 Replies)
Discussion started by: zhen
11 Replies
2. Shell Programming and Scripting
Hi,
Please let me know how do we write a piece of code to extract characters from a line using SED. (2 Replies)
Discussion started by: Shilpi
2 Replies
3. Shell Programming and Scripting
Hi,
Please let me know how do we write a piece of code to extract characters from a line using SED. (1 Reply)
Discussion started by: Shilpi
1 Replies
4. Shell Programming and Scripting
I have the following string:
<min-pool-size>2</min-pool-size>
When I pipe the string into the following code I am expcting for it to return just the value "2", but its just reurning the whole string. Why??
sed -n '/<min-pool-size>/,/<\/min-pool-size>/p'
Outputting:... (13 Replies)
Discussion started by: ArterialTool
13 Replies
5. Shell Programming and Scripting
Hello,
I am new to sed and am trying to extract a word using sed.
for example i have a line "const TotalAmount& getTotalAmount() const; " in the file test.txt
I am trying to extract getTotalAmount() from the line.
For this i tried
cat test.txt | sed -n 's/.*get*\(\)//p
But... (8 Replies)
Discussion started by: prasbala
8 Replies
6. Shell Programming and Scripting
I have an xml file that generally looks like this:
"<row><dnorpattern>02788920</dnorpattern><description/></row><row><dnorpattern>\+
44146322XXXX</dnorpattern><description/></row><row><dnorpattern>40XXX</dnorpattern><description/></row><row><dnorpattern>11</dn... (4 Replies)
Discussion started by: garboon
4 Replies
7. Shell Programming and Scripting
Given a file with contents
/arch/powerpc/boot/4xx.o
> /arch/powerpc/boot/.4xx.o.cmd
> /arch/powerpc/boot/addnote
5766a5769
> /arch/powerpc/boot/.addnote.cmd
5768a5772,5773
> /arch/powerpc/boot/bamboo.o
> /arch/powerpc/boot/.bamboo.o.cmd
5769a5775,5778
> /arch/powerpc/boot/cpm-serial.o... (8 Replies)
Discussion started by: xerox
8 Replies
8. Shell Programming and Scripting
Hello,
I have huge number files in a directory. All files have the data. I want extract data. I want all output write to single csv file.
following codes works. Thank you very much for help.
sed -n '/.*Content$txtE_Zip" type="text" value="\(*\)" maxlength.*/s//\1/p' *>file1
sed -n... (5 Replies)
Discussion started by: hoo
5 Replies
9. Shell Programming and Scripting
Hi,
I have a text file containing 2 lines as follows:
I'm trying to extract all the strings following an "AME." The output would be as follows:
BUSINESS_UNIT
PROJECT_ID
ACTIVITY_ID
RES_USER1
RESOURCE_ID_FROM
ANALYSIS_TYPE
BI_DISTRIB_STATUS
BUSINESS_UNIT
PROJECT_ID
ACTIVITY_ID... (5 Replies)
Discussion started by: simpletech369
5 Replies
10. Shell Programming and Scripting
I have this command to replace the version value from PROGRAM (for example here PROGRAM == player) by NEWVERSION
sed "/^ *$PROGRAM:/{N; s/*$/ $NEWVERSION/;}" -i $PRDFILE
player:
version: V6R2013xD3HF5v1
player_old:
version: V6R2013xD3HF5v1
partchecker:
version:... (2 Replies)
Discussion started by: jcanale
2 Replies
LEARN ABOUT DEBIAN
tm::coverage
TM::Coverage(3pm) User Contributed Perl Documentation TM::Coverage(3pm)
NAME
TM::Coverage - Topic Maps, Code Coverage
DESCRIPTION
This auxiliary package keeps track of the code coverage. Probably quite irrelevant for a user.
Automatically generated for TM (1.44).
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/TM.pm 96.4 84.5 58.0 93.7 90.6 27.5 89.6
blib/lib/TM/Analysis.pm 100.0 90.9 n/a 100.0 100.0 0.0 97.5
blib/lib/TM/AsTMa/Fact.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
blib/lib/TM/AsTMa/Fact2.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
blib/lib/TM/Bulk.pm 76.8 71.4 62.5 85.7 100.0 0.0 75.3
blib/lib/TM/CTM/CParser.pm 65.6 34.3 31.0 84.6 0.0 1.6 52.5
blib/lib/TM/CTM/Parser.pm 90.9 50.0 n/a 100.0 0.0 0.0 79.4
blib/lib/TM/DM.pm 100.0 65.0 66.7 100.0 n/a 0.0 96.5
blib/lib/TM/Graph.pm 99.1 88.5 n/a 100.0 100.0 0.0 97.4
blib/lib/TM/Index.pm 100.0 80.0 60.0 100.0 83.3 0.3 87.8
.../Index/Characteristics.pm 100.0 100.0 n/a 100.0 0.0 0.0 97.0
blib/lib/TM/Index/Match.pm 98.5 87.5 n/a 100.0 100.0 0.5 97.6
blib/lib/TM/LTM/CParser.pm 84.9 45.3 42.7 98.2 0.0 0.2 67.8
blib/lib/TM/LTM/Parser.pm 95.7 62.5 50.0 100.0 0.0 0.0 87.1
blib/lib/TM/Literal.pm 45.8 0.0 11.8 30.0 0.0 0.4 24.2
blib/lib/TM/MapSphere.pm 96.5 84.6 68.8 100.0 100.0 0.0 91.7
.../TM/Materialized/AsTMa.pm 100.0 n/a n/a 100.0 0.0 0.0 95.5
...ib/TM/Materialized/LTM.pm 100.0 n/a n/a 100.0 0.0 0.0 95.5
.../TM/Materialized/MLDBM.pm 100.0 83.3 n/a 100.0 0.0 0.0 92.6
...b/TM/Materialized/Null.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
...TM/Materialized/Stream.pm 100.0 100.0 100.0 100.0 0.0 0.0 96.0
...ib/TM/Materialized/XTM.pm 100.0 n/a n/a 100.0 0.0 0.0 96.7
blib/lib/TM/PSI.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
blib/lib/TM/QL.pm 91.4 61.5 66.7 100.0 50.0 0.1 83.9
blib/lib/TM/QL/CParser.pm 76.2 42.4 41.9 90.3 0.0 9.1 62.0
blib/lib/TM/QL/PE.pm 83.8 77.3 80.0 91.7 0.0 52.5 80.5
blib/lib/TM/QL/TS.pm 65.2 35.4 27.8 70.8 53.3 2.4 56.9
blib/lib/TM/ResourceAble.pm 88.1 87.5 n/a 100.0 100.0 0.0 90.0
.../TM/ResourceAble/MLDBM.pm 100.0 75.0 n/a 100.0 0.0 0.0 94.2
blib/lib/TM/Serializable.pm 94.9 65.6 100.0 100.0 100.0 0.0 84.1
.../TM/Serializable/AsTMa.pm 99.1 87.9 66.7 100.0 100.0 0.0 94.2
...TM/Serializable/Dumper.pm 100.0 n/a n/a 100.0 0.0 0.0 93.5
...ib/TM/Serializable/LTM.pm 94.1 n/a n/a 83.3 100.0 0.0 92.0
...ib/TM/Serializable/XTM.pm 96.3 85.2 72.9 100.0 100.0 0.2 91.5
.../lib/TM/Synchronizable.pm 100.0 75.0 100.0 100.0 100.0 0.0 97.2
...M/Synchronizable/MLDBM.pm 100.0 50.0 n/a 100.0 0.0 0.0 89.3
...nchronizable/MapSphere.pm 100.0 63.6 64.3 100.0 100.0 0.0 88.6
...TM/Synchronizable/Null.pm 100.0 n/a n/a 100.0 0.0 0.0 87.5
blib/lib/TM/Tau.pm 100.0 91.7 80.0 100.0 0.0 0.0 95.6
blib/lib/TM/Tau/Federate.pm 63.2 39.3 n/a 62.5 27.3 0.0 54.5
blib/lib/TM/Tau/Filter.pm 100.0 91.7 66.7 100.0 50.0 0.0 90.0
.../TM/Tau/Filter/Analyze.pm 100.0 n/a n/a 100.0 100.0 0.0 100.0
blib/lib/TM/Tree.pm 100.0 57.1 44.4 100.0 66.7 0.0 88.0
blib/lib/TM/Utils.pm 100.0 50.0 n/a 100.0 0.0 0.0 89.3
...ib/TM/Utils/TreeWalker.pm 100.0 100.0 n/a 100.0 0.0 0.0 96.0
...ib/TM/Workbench/Plugin.pm 100.0 n/a n/a 100.0 0.0 0.0 75.0
...M/Workbench/Plugin/Tau.pm 87.5 50.0 n/a 80.0 0.0 0.0 73.1
yapp/astma-fact.yp 96.9 91.5 73.3 97.8 0.0 4.8 92.7
yapp/astma2-fact.yp 97.4 91.6 58.3 100.0 0.0 0.2 91.6
Total 76.8 45.2 40.2 91.2 57.0 100.0 63.8
---------------------------- ------ ------ ------ ------ ------ ------ ------
SEE ALSO
TM
COPYRIGHT AND LICENSE
Copyright 200[8] by Robert Barta, <drrho@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2008-10-05 TM::Coverage(3pm)