Sponsored Content
Top Forums Shell Programming and Scripting awk to print exact field number Post 302380068 by covis on Monday 14th of December 2009 05:37:50 AM
Old 12-14-2009
I can't really understand why we take this "i<=(length(var)+1)/2" in for but it works great.
Thanx a lot Smilie Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

use awk to aggregrate the field number

Hi, I have a various files;each filled with hundreds of line with similar number of fields. I would like to extract out field $5 from each of this file and aggregate them before printing out to a file. I tried to :- #!/usr/bin/awk -f file="file1.txt file2.txt file3.txt file4.txt" ... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

2. Shell Programming and Scripting

Print matching field using awk

Hi All, I have a string like below: str="Hold=True Map=False 'This will map the data' Run=Yes Modify=False" I want to print the field Run=Yes and retrive the value "Yes". I cannot use simple awk command because the position of the "Run" will be different at different times. Is there a way... (6 Replies)
Discussion started by: deepakgang
6 Replies

3. UNIX for Dummies Questions & Answers

[awk] print from field n to field x

Hi, I'm trying to print every line from first field to the fourth from a file containing more. $ cat input a b c d e f g a b c d e f gI'm trying awk '{for (i=1; i <= NF-3; i++) print $i}' awkTest.datbut it printsa b c d a b c dSo, I easily guess I'm wrong. :) Of course, I want:a b... (5 Replies)
Discussion started by: daPeach
5 Replies

4. UNIX for Advanced & Expert Users

Awk command to print the field

894344202808090;11122;040320 075858 166;101;0;0;10u;0;NA;65;221890;2;101973;185059;568674;Y; PRE;0;0;NA;NA;0;NA;0;NA;textmsg;textmsg_snd1;telusmob;TEXTMSG1;0.15000000;126037;2010/03/04 12:58:57gmt;0;70532192; plz tell me any awk command which on the basis of the yellow field which is... (1 Reply)
Discussion started by: madfox
1 Replies

5. Shell Programming and Scripting

awk - print all fields except for last field

How do I print all the fields of a record except for the $(NF) field? (4 Replies)
Discussion started by: locoroco
4 Replies

6. Shell Programming and Scripting

AWK print number of records, divide this number

I would like to print the number of records of 2 files, and divide the two numbers awk '{print NR}' file1 > output1 awk '{print NR}' file2 > output2 paste output1 output2 > output awl '{print $1/$2}' output > output_2 is there a faster way? (8 Replies)
Discussion started by: programmerc
8 Replies

7. UNIX for Dummies Questions & Answers

Print first field in awk

Hi, I have below text file 01.02.2014,asdas,arse,aere,4tfsd 12.03.2014,sdte,45gf,8iuj,qw343w 01.02.0214,aetre,sdfgter,asfrwe I have writen below code to print only first field that is only date field from text file #!/bin/ksh echo "enter week" read week while read -r... (6 Replies)
Discussion started by: stew
6 Replies

8. UNIX for Dummies Questions & Answers

Print first field using awk

I want to print line by line only the first field from txt file input file etr,t7tu,e45xdt,e45exgt,cdgfe aqw34aw,45edgf,45estd,sert34 a232e,4etedf,w345er,qw345rw, qw354,q34asf,tw45f,q3drsf required o/p file etr aqw34aw a232e qw354 (1 Reply)
Discussion started by: stew
1 Replies

9. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies

10. Shell Programming and Scripting

awk sum of all columns needs to print exact amount

Hi I have attached txt file as input, and i'm able to calculate sum of columns at the end but the format of sum is not coming up right. awk -F"," '{for (i=4;i<=NF;i++) sum+=$i}{print}; END { sum="Total:"; for (i=1;i<=NF;i++) {printf sum ","} print "\n"}' input.txt check the o/p file, at... (6 Replies)
Discussion started by: manas_ranjan
6 Replies
SSL_CTX_new(3SSL)                                                     OpenSSL                                                    SSL_CTX_new(3SSL)

NAME
SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled functions SYNOPSIS
#include <openssl/ssl.h> SSL_CTX *SSL_CTX_new(const SSL_METHOD *method); DESCRIPTION
SSL_CTX_new() creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections. NOTES
The SSL_CTX object uses method as connection method. The methods exist in a generic type (for client and server use), a server only type, and a client only type. method can be of the following types: SSLv2_method(void), SSLv2_server_method(void), SSLv2_client_method(void) A TLS/SSL connection established with these methods will only understand the SSLv2 protocol. A client will send out SSLv2 client hello messages and will also indicate that it only understand SSLv2. A server will only understand SSLv2 client hello messages. SSLv3_method(void), SSLv3_server_method(void), SSLv3_client_method(void) A TLS/SSL connection established with these methods will only understand the SSLv3 protocol. A client will send out SSLv3 client hello messages and will indicate that it only understands SSLv3. A server will only understand SSLv3 client hello messages. This especially means, that it will not understand SSLv2 client hello messages which are widely used for compatibility reasons, see SSLv23_*_method(). TLSv1_method(void), TLSv1_server_method(void), TLSv1_client_method(void) A TLS/SSL connection established with these methods will only understand the TLSv1 protocol. A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages. This especially means, that it will not understand SSLv2 client hello messages which are widely used for compatibility reasons, see SSLv23_*_method(). It will also not understand SSLv3 client hello messages. SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void) A TLS/SSL connection established with these methods will understand the SSLv2, SSLv3, and TLSv1 protocol. A client will send out SSLv2 client hello messages and will indicate that it also understands SSLv3 and TLSv1. A server will understand SSLv2, SSLv3, and TLSv1 client hello messages. This is the best choice when compatibility is a concern. The list of protocols available can later be limited using the SSL_OP_NO_SSLv2, SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1 options of the SSL_CTX_set_options() or SSL_set_options() functions. Using these options it is possible to choose e.g. SSLv23_server_method() and be able to negotiate with all possible clients, but to only allow newer protocols like SSLv3 or TLSv1. SSL_CTX_new() initializes the list of ciphers, the session cache setting, the callbacks, the keys and certificates, and the options to its default values. RETURN VALUES
The following return values can occur: NULL The creation of a new SSL_CTX object failed. Check the error stack to find out the reason. Pointer to an SSL_CTX object The return value points to an allocated SSL_CTX object. SEE ALSO
SSL_CTX_free(3), SSL_accept(3), ssl(3), SSL_set_connect_state(3) 1.0.1e 2013-02-11 SSL_CTX_new(3SSL)
All times are GMT -4. The time now is 07:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy