Sponsored Content
Top Forums UNIX for Dummies Questions & Answers AWK print last field including SPACES Post 302707523 by quay on Friday 28th of September 2012 08:27:45 PM
Old 09-28-2012
oops

thanks vidyadhar85, but same issue.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read files including spaces

I am accessing two files. I am using read command to read from the files. For the first file, I need read the fields delimited by spaces, and for the other file, I need to read the whole line as a single field including the spaces. When I used read command for the second file, the spaces... (4 Replies)
Discussion started by: kumariak
4 Replies

2. Shell Programming and Scripting

including spaces in awk output

I need to tweek my awk output: #cat filename ab cd ef:ghi:jk lm:nop qrs #cat filename | awk '{ for(i=3;i<NF+1;i++) printf $i}' ef:ghi:jklm:nopqrs I would like the ouput to include the original spaces from columns 3 on: ef:ghi:jk lm:nop qrs any suggestions? (4 Replies)
Discussion started by: prkfriryce
4 Replies

3. UNIX for Dummies Questions & Answers

Reading a line including spaces

Hi All, I have a script that reads a file and echo it back to std out. Test.txt 1aaaaaaaaaaa . The script is ReadLine.sh #!/bin/ksh cat $1 | while read file do echo $file done I invoke the script as ReadLine.sh Test.txt The output that I get is (1 Reply)
Discussion started by: aksarben
1 Replies

4. Shell Programming and Scripting

How to print arguments along with spaces using awk

Hi All, file_1.txt contains aaa bbbb hhhh vvvvv mmmmm iiiii What i want is to search for the first coloumn of each line using awk.i.e as below: awk '/aaa/ {printf(<>)}' file_1.txt The print part (<>) should contain all the values(or coloumns ) in the particular line(here it... (8 Replies)
Discussion started by: jisha
8 Replies

5. 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

6. Shell Programming and Scripting

Print filenames with spaces using awk

Hello all, I want to list the file contents of the directory and number them. I am using la and awk to do it now, #ls |awk '{print NR "." $1}' 1. alpha 2. beta 3. gamma The problem I have is that some files might also have some spaces in the filenames. #ls alpha beta gamma ... (7 Replies)
Discussion started by: grajp002
7 Replies

7. UNIX for Dummies Questions & Answers

Print files with spaces using awk

When I use: find . -ls | awk 'BEGIN { OFS = ";"} {print $1,$2,$11}'I get a nice result, yet the files with spaces in it show only the first word and all other characters after the blank space are not printed. e.g. 'file with a blank space' is printed file 'file_with a blank space' is... (7 Replies)
Discussion started by: dakke
7 Replies

8. Shell Programming and Scripting

awk - print columns with text and spaces

Hi, I'm using awk to print columns from a tab delimited text file: awk '{print " "$2" "$3" $6"}' file The problem I have is column 6 contains text with spaces etc which means awk only prints the first word. How can I tell awk to print the whole column content as column 6? Thanks, (10 Replies)
Discussion started by: keenboy100
10 Replies

9. Shell Programming and Scripting

awk - CSV file - field with single or multiple spaces

Hi, In a csv file, I want to select records where first column has zero or multiple spaces. Eg: abc.csv ,123,a ,22,b ,11,c a,11,d So output should be: ,123,a ,22,b ,11,c Please advise (5 Replies)
Discussion started by: vegasluxor
5 Replies

10. Shell Programming and Scripting

awk print string with removing all spaces

Hi all, I want to set 10 set of strings into a variable where: removing all spaces within each string change the delimiter from "|" to "," Currently, I've the below script like this:Table=`ten character strings with spaces in-between and each string with delimiter "|" | tr -d ' ' |... (7 Replies)
Discussion started by: o1283c
7 Replies
PKI(1)								    strongSwan								    PKI(1)

NAME
pki - Simple public key infrastructure (PKI) management tool SYNOPSIS
pki command [option ...] pki -h | --help DESCRIPTION
pki is a suite of commands that allow you to manage a simple public key infrastructure (PKI). Generate RSA and ECDSA key pairs, create PKCS#10 certificate requests containing subjectAltNames, create X.509 self-signed end-entity and root CA certificates, issue end-entity and intermediate CA certificates signed by the private key of a CA and containing subjectAltNames, CRL distribution points and URIs of OCSP servers. You can also extract raw public keys from private keys, certificate requests and certifi- cates and compute two kinds of SHA-1-based key IDs. COMMANDS
-h, --help Prints usage information and a short summary of the available commands. -g, --gen Generate a new private key. -s, --self Create a self-signed certificate. -i, --issue Issue a certificate using a CA certificate and key. -c, --signcrl Issue a CRL using a CA certificate and key. -r, --req Create a PKCS#10 certificate request. -7, --pkcs7 Provides PKCS#7 wrap/unwrap functions. -k, --keyid Calculate key identifiers of a key or certificate. -a, --print Print a credential (key, certificate etc.) in human readable form. -p, --pub Extract a public key from a private key or certificate. -v, --verify Verify a certificate using a CA certificate. EXAMPLES
Generating a CA Certificate The first step is to generate a private key using the --gen command. By default this generates a 2048-bit RSA key. pki --gen > ca_key.der This key is used to create the self-signed CA certificate, using the --self command. The distinguished name should be adjusted to your needs. pki --self --ca --in ca_key.der --dn "C=CH, O=strongSwan, CN=strongSwan CA" > ca_cert.der Generating End-Entity Certificates With the root CA certificate and key at hand end-entity certificates for clients and servers can be issued. Similarly intermediate CA cer- tificates can be issued, which in turn can issue other certificates. To generate a certificate for a server, we start by generating a pri- vate key. pki --gen > server_key.der The public key will be included in the certificate so lets extract that from the private key. pki --pub --in server_key.der > server_pub.der The following command will use the CA certificate and private key to issue the certificate for this server. Adjust the distinguished name, subjectAltName(s) and flags as needed (check pki --issue(8) for more options). pki --issue --in server_pub.der --cacert ca_cert.der --cakey ca_key.der --dn "C=CH, O=strongSwan, CN=VPN Server" --san vpn.strongswan.org --flag serverAuth > server_cert.der Instead of storing the public key in a separate file, the output of --pub may also be piped directly into the above command. Generating Certificate Revocation Lists (CRL) If end-entity certificates have to be revoked, CRLs may be generated using the --signcrl command. pki --signcrl --cacert ca_cert.der --cakey ca_key.der --reason superseded --cert server_cert.der > crl.der The certificate given with --cacert must be either a CA certificate or a certificate with the crlSign extended key usage (--flag crlSign). URIs to CRLs may be included in issued certificates with the --crl option. SEE ALSO
pki --gen(1), pki --self(1), pki --issue(1), pki --signcrl(1), pki --req(1), pki --pkcs7(1), pki --keyid(1), pki --print(1), pki --pub(1), pki --verify(1) 5.1.1 2013-07-31 PKI(1)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy