Sponsored Content
Top Forums Shell Programming and Scripting Formatting The Output Files & Matching Keys Post 302921846 by Ariean on Monday 20th of October 2014 02:01:48 PM
Old 10-20-2014
Formatting The Output Files & Matching Keys

I have the following 2 output files, one contain the standard output after i decrypt the encrypted file and another keys listed from the gpg trust db,

Provider File:
Code:
gpg: encrypted with 2048-bit RSA key, ID 96301328, created 2014-04-29
      "JKL <400@abc.com>"
gpg: encrypted with 2048-bit ELG-E key, ID ECB614CF, created 2002-02-06
      "GHI <300@abc.com>"
gpg: encrypted with 2048-bit ELG-E key, ID 1EB07C50, created 2014-02-20
      "ABC <100@abc.com>"
gpg: WARNING: message was not integrity protected


GPG Public Keys:
Code:
pub   1024D/17CD2890 2014-02-20
uid                  ABC <100@abc.com>
sub   2048g/1EB07C50 2014-02-20

pub   2048D/8911CBCA 2014-04-03
uid                  DEF <200@abc.com>
sub   2048g/F0E4D9C3 2014-04-03

pub   1024D/CB26F4C3 2002-02-06
uid                  GHI <300@abc.com>
sub   2048g/ECB614CF 2002-02-06

pub   2048R/547A8D75 2014-04-29
uid                  JKL <400@abc.com>
sub   2048R/96301328 2014-04-29

My requirements
1) After i decrypt the file i need to make sure there are three keys embedded or used to encrypt the file, i have to get the count from the file decryption output as shown in "Provider File" excerpt above.
2) I have to search for appropriate UID's and take the corresponding values 96301328,ECB614CF,1EB07C50 from "Provider File" and match those values with "GPG Public Keys" file and email out which key is different and associated email id.

For 1, i have following snippet awk -F"[<>]" '/@/ {L++ ; print $2} END{print L+0}' from a friend but how do i supress the email id's and just print only count?
For 2, I am still working on it?

Appreciate your inputs please help.

Last edited by Ariean; 10-20-2014 at 03:09 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

formatting output

my script is as follows cnt=`ps -ef |grep pmon|grep -v grep|awk 'END {{print NR}}'` cnt2=`ps -ef |grep tns|grep -v grep|awk 'END {{print NR}}'` if then if then rman target/ catalog recdb/recdb@recdb cmdfile report_need_backup.sql > report_need_backup.txt ... (1 Reply)
Discussion started by: swkambli
1 Replies

2. Shell Programming and Scripting

Output formatting

I have input file in this way John 1234 BASIC 26000 John 1234 ALLOWC 01550 John 1234 INCER 01700 John 1234 REL 20000 Debi 2345 BASIC 29000 Debi 2345 ALLOWC 01600 Debi 2345 INCR 01900 Debi 2345 REL ... (8 Replies)
Discussion started by: vakharia Mahesh
8 Replies

3. Shell Programming and Scripting

Output formatting .

below is a CPU utilization Log for ABC server. However for every 15 minutes it generates 3 CPU values(with interval of 2 sec). Host CPU CPUtotal CPU% time ABC 101.1 2 50.55 14 : 15 ABC 100.5 2 50.25 14 : 15 ABC 100.2 2 50.1 14 : 15 ABC 100.9 2 50.45 14 : 30 ABC 100.5 2 50.25 14 : 30 ABC... (5 Replies)
Discussion started by: pinga123
5 Replies

4. Shell Programming and Scripting

Problem with call of Java Programm & return code handling & output to several streams.

Hello Everybody, thanks in advance for spending some time in my problem. My problem is this: I want to call a java-Programm out of my shell skript, check if die return code is right, and split the output to the normal output and into a file. The following code doesn't work right, because in... (2 Replies)
Discussion started by: danifunny
2 Replies

5. Shell Programming and Scripting

How to combine 2 files and output the unique & difference?

Hi Guys, I have two input files and I want to combine them and get the unique values and differences and put them into one file. See below desired output file. Inputfile1: 1111111 2222222 3333333 7860068 7860069 7860071 7860072 Inputfile2: 4444444 (4 Replies)
Discussion started by: pinpe
4 Replies

6. UNIX for Dummies Questions & Answers

Formatting df output

Hi all, Can anyone please suggest how best to handle output from running df where some of the information for a volume/filesystem spread over two lines? Some of my volume/filesytem are NFS mounted and when I run a df, the information is spread over the two lines instead of the usual norm... (4 Replies)
Discussion started by: newbie_01
4 Replies

7. Shell Programming and Scripting

awk help: Match data fields from 2 files & output results from both into 1 file

I need to take 2 input files and create 1 output based on matches from each file. I am looking to match field #1 in both files (Userid) and create an output file that will be a combination of fields from both file1 and file2 if there are any differences in the fields 2,3,4,5,or 6. Below is an... (5 Replies)
Discussion started by: ambroze
5 Replies

8. Shell Programming and Scripting

Formatting output

I have the output like below: DEV#: 9 DEVICE NAME: hdisk9 TYPE: 1750500 ALGORITHM: Load Balance SERIAL: 68173531021 ========================================================================== Path# Adapter/Path Name State Mode Select Errors 0 ... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

9. Shell Programming and Scripting

If && command giving wrong output

Hi All, I am trying to run a script which will search for 2 strings(stopped,started) in a text file and echo an output depending on below condition -bash-3.2$ cat trial1.txt v ggg f -bash-3.2$ cat trial1.sh VAR9=` grep 'stopped' /tmp/trial1.txt` VAR10=` grep 'started'... (4 Replies)
Discussion started by: srkmish
4 Replies
crypt(1)						      General Commands Manual							  crypt(1)

NAME
crypt - encode/decode SYNOPSIS
crypt key < input.File > output.File DESCRIPTION
The command reads from the standard input and writes on the standard output. You must supply a key which selects a particular transforma- tion. If no password is given, demands a key from the terminal and turns off printing while the key is being typed in. The command encrypts and decrypts with the same key. Files encrypted by are compatible with those treated by the ed, ex and vi editors in encryption mode. The security of encrypted files depends on three factors: the fundamental method must be hard to solve, direct search of the key space must be infeasible, and sneak paths by which keys or clear text can become visible must be minimized. The command implements a one-rotor machine designed along the lines of the German Enigma, but with a 256-element rotor. Methods of attack on such machines are known, but not widely; moreover the amount of work required is likely to be large. The transformation of a key into the internal settings of the machine is deliberately designed to be expensive, for example, to take a sub- stantial fraction of a second to compute. However, if keys are restricted to three lowercase letters, then encrypted files can be read by expending only a substantial fraction of five minutes of machine time. Since the key you choose is an argument to the command, it is potentially visible to users executing the command or a derivative. To mini- mize this possibility, destroys any record of the key immediately upon entry. The most vulnerable aspect of is the choice of keys and key security. EXAMPLES
The following examples use KEY as the key to encrypt and decrypt files. The first example encrypts the file naming the resulting encrypted file The second example decrypts the file naming the resulting decrypted file The third example prints the encrypted file in clear text. $ crypt KEY < plain.File > crypt.File $ crypt KEY < crypt.File > decrypt.File $ crypt KEY < crypt.File | pr FILES
for typed key RELATED INFORMATION
ed(1), ex(1), vi(1), crypt(3), makekey(8) delim off crypt(1)
All times are GMT -4. The time now is 09:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy