Sponsored Content
Top Forums Shell Programming and Scripting how to extract a certain part of a line Post 302534655 by rpf on Tuesday 28th of June 2011 11:29:24 AM
Old 06-28-2011
Is it possible to define a function that extracts the certain part of subsequent line when I copy the whole line after it. For example, when I type

rpf home/1245/hgdf/acsdf/myhome/afolder/H2O/endfile

output will be /myhome/afolder/H2O/endfile

can I define a function rpf like this ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract a part of file name

Hi, I want to extract a part of filename and pass it as a parameter to one of the scripts. Could someone help. File name:- NLL_NAM_XXXXX.XXXXXXX_1_1.txt. Here i have to extract only XXXXX.XXXXXXX and the position will be constant. that means that i have to extract some n characters from... (6 Replies)
Discussion started by: dnat
6 Replies

2. Shell Programming and Scripting

extract last part of string.

Hi, I have a string like this BUNDLE=/home/bob/flx/user.bun how to extract only the the last part ie, only user.bun (2 Replies)
Discussion started by: vprasads
2 Replies

3. Shell Programming and Scripting

how to extract part of xml line via awk?

Hi, I like to set a variable "name" automatically by reading an xml file. My code looks like this: set name = `awk '/<generationTime>/,/<\/generationTime>/ p' $xml_name` the "name" is thus set to <generationTime>2004-12-01T08:23:50.000000</generationTime> How can I separate this line,... (3 Replies)
Discussion started by: friend
3 Replies

4. Shell Programming and Scripting

How to extract part of xml line via awk?

Hi, I like to set a variable "name" automatically by reading an xml file. The name should be set to the date, which is a part of the following line of the xml file: <sceneID>C82_N32_A_SM_strip_008_R_2009-11-24T04:22:12.790028Z</sceneID> How can I separate this line, that the name will... (6 Replies)
Discussion started by: friend
6 Replies

5. Shell Programming and Scripting

How to extract one part from whole output

Hi All, I am trying to write a small shell programming to get db2 database size info. The command I am going to use is- db2 "CALL GET_DBSIZE_INFO(?, ?, ?, -1)" and the output of above command generally is- Value of output parameters -------------------------- Parameter Name :... (4 Replies)
Discussion started by: NARESH1302
4 Replies

6. Shell Programming and Scripting

Help with extract particular part of data

Input file <data> <temporary>qe2qrqerq qwewqeqwrqwrq qrerwrewrwer </temporary> </data> <sample>@!@##%#</sample> <info>12345</info> <content>2313214141454</content> <data> <temporary>qe2qrqerq qrerwrewrwer </temporary> <content>123214214523</content> </data>... (5 Replies)
Discussion started by: perl_beginner
5 Replies

7. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

8. Shell Programming and Scripting

Extract part of a string

I have a file with 100s of lines of text. I want to perform an extraction of this line: Info bpzs(pid=2652) using 1000 bits I have not been able to extract it. Should I try expr match or is there another method? This line has data both in front of and in back of it. I do not have grep -o... (5 Replies)
Discussion started by: newbie2010
5 Replies

9. UNIX for Advanced & Expert Users

Need help to extract part of the string

Hi, I have a string with name as 20140412-s1-Potopolive_promos_20140412. So I want to extract only Potopolive string. Could you please help me the command. O/p : Potopolive Thx in advance (5 Replies)
Discussion started by: lkeswar
5 Replies

10. Shell Programming and Scripting

Extract a part of variable/line content in a file

I have a variable and assigned the following values ***XYZ_201519_20150929140642_20150929140644_211_0_0_211 I need to read this variable from backward and stop read when I get first underscore (_) In this scenario I should get 211 Thanks Kris (3 Replies)
Discussion started by: mkris
3 Replies
BIO_find_type(3)						      OpenSSL							  BIO_find_type(3)

NAME
BIO_find_type, BIO_next - BIO chain traversal SYNOPSIS
#include <openssl/bio.h> BIO * BIO_find_type(BIO *b,int bio_type); BIO * BIO_next(BIO *b); #define BIO_method_type(b) ((b)->method->type) #define BIO_TYPE_NONE 0 #define BIO_TYPE_MEM (1|0x0400) #define BIO_TYPE_FILE (2|0x0400) #define BIO_TYPE_FD (4|0x0400|0x0100) #define BIO_TYPE_SOCKET (5|0x0400|0x0100) #define BIO_TYPE_NULL (6|0x0400) #define BIO_TYPE_SSL (7|0x0200) #define BIO_TYPE_MD (8|0x0200) #define BIO_TYPE_BUFFER (9|0x0200) #define BIO_TYPE_CIPHER (10|0x0200) #define BIO_TYPE_BASE64 (11|0x0200) #define BIO_TYPE_CONNECT (12|0x0400|0x0100) #define BIO_TYPE_ACCEPT (13|0x0400|0x0100) #define BIO_TYPE_PROXY_CLIENT (14|0x0200) #define BIO_TYPE_PROXY_SERVER (15|0x0200) #define BIO_TYPE_NBIO_TEST (16|0x0200) #define BIO_TYPE_NULL_FILTER (17|0x0200) #define BIO_TYPE_BER (18|0x0200) #define BIO_TYPE_BIO (19|0x0400) #define BIO_TYPE_DESCRIPTOR 0x0100 #define BIO_TYPE_FILTER 0x0200 #define BIO_TYPE_SOURCE_SINK 0x0400 DESCRIPTION
The BIO_find_type() searches for a BIO of a given type in a chain, starting at BIO b. If type is a specific type (such as BIO_TYPE_MEM) then a search is made for a BIO of that type. If type is a general type (such as BIO_TYPE_SOURCE_SINK) then the next matching BIO of the given general type is searched for. BIO_find_type() returns the next matching BIO or NULL if none is found. Note: not all the BIO_TYPE_* types above have corresponding BIO implementations. BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs in a chain or used in conjunction with BIO_find_type() to find all BIOs of a certain type. BIO_method_type() returns the type of a BIO. RETURN VALUES
BIO_find_type() returns a matching BIO or NULL for no match. BIO_next() returns the next BIO in a chain. BIO_method_type() returns the type of the BIO b. NOTES
BIO_next() was added to OpenSSL 0.9.6 to provide a 'clean' way to traverse a BIO chain or find multiple matches using BIO_find_type(). Previous versions had to use: next = bio->next_bio; BUGS
BIO_find_type() in OpenSSL 0.9.5a and earlier could not be safely passed a NULL pointer for the b argument. EXAMPLE
Traverse a chain looking for digest BIOs: BIO *btmp; btmp = in_bio; /* in_bio is chain to search through */ do { btmp = BIO_find_type(btmp, BIO_TYPE_MD); if(btmp == NULL) break; /* Not found */ /* btmp is a digest BIO, do something with it ...*/ ... btmp = BIO_next(btmp); } while(btmp); SEE ALSO
TBA 50 2013-03-05 BIO_find_type(3)
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy