Sponsored Content
Top Forums Shell Programming and Scripting ksh / AIX - Differences between lists to a text file Post 303039313 by jeffs42885 on Monday 30th of September 2019 03:01:00 PM
Old 09-30-2019
ksh / AIX - Differences between lists to a text file

This seems pretty simple, but I cant figure it out. I get stumped on the simple things.




I am running two commands


1) take a listing a directory of files, and filter out the doc_name (which is in a series of extracted files), and place it in a file.
Code:
ls -l | awk '{print $9}' | grep out | cut -d. -f1 >> Extracted.out

2) I then have a list of expected files that should have been retrieved -


Code:
more Expected.del | cut -d, -f1 >> Original.out

3) My desired output is a listing, something along the lines of -


Code:

someCommand Extracted.out Original.out >> Results.out

Results.out
doc_name1 is missing
doc_name2 is missing
doc_name3 is missing

I've tried using a variety of diff, sort, etc.. But I figure that there's a way to use sed/awk to do this, but of which I am a newbie with. Can someone point me in the right direction.
thanks in advance.
 

10 More Discussions You Might Find Interesting

1. BSD

OpenBSD sh and ksh differences?

Hi, I am running OpenBSD 3.7, my first attempt with this OS. I noticed that both /bin/sh and /bin/ksh are both really the pdksh. Yet each has its own manpage. I was wondering what are the differences b/w the two programs on OpenBSD. I.e., has the team configured pdksh to function one way if... (3 Replies)
Discussion started by: hadarot
3 Replies

2. Shell Programming and Scripting

Create multiple text file from a single text file on AIX

Hi I need to create multiple text files from onc text file on AIX. The data of text files is as below: ********************************************** ********************************************** DBVERIFY: Release 10.2.0.4.0 - Production on Tue Nov 10 13:45:42 2009 Copyright (c) 1982,... (11 Replies)
Discussion started by: lodhi1978
11 Replies

3. UNIX for Dummies Questions & Answers

Compare and merging the differences in text file

Hi i have gone through some sdiff command it shows the differences side by side and its really awesome file 1: this tool is for checking the differ merging with flower pots documentation file 2: this t ool is for checking the differ mergin g with flower pots documentation ... (27 Replies)
Discussion started by: rakeshkumar
27 Replies

4. AIX

Aix process CPU differences.

Hi, I'm trying to create a script to catch a process which is consuming high CPU which I have pretty much done but it's just finding the correct place to pull the current CPU for that process. When viewed in Topas it's consuming 99.*% cpu But if I try using ps avg or ps -eo pcpu ... (5 Replies)
Discussion started by: elmesy
5 Replies

5. Shell Programming and Scripting

Separate Text File into Two Lists Using Python

Hello, I have a pretty simple question, but I am new to Python and am trying to write a simple program. Put simply, I want to take a text file that looks like this: 11111 22222 33333 44444 55555 66666 77777 88888 and produce two lists, one containing the contents of the left column, one the... (0 Replies)
Discussion started by: Tyler_92
0 Replies

6. UNIX for Advanced & Expert Users

Help understanding differences between AIX and RHEL

I have started a new job which requires AIX admin skills, which I have, and RHEL skills. Does anyone have a cheat sheet that if I know how to solve the problem in AIX how would I do that in RHEL? I was an IBM pre-sales technical trying to keep sales guys honest - not possible. Any other links to... (5 Replies)
Discussion started by: SpenceSnyder
5 Replies

7. Shell Programming and Scripting

Manipulating field differences using ksh

I have a list of files that should contain the following Im trying to find the items of interest that are missing from each file and create a csv. cat *.txt | while read file do grep 3500 file | tr '\012' ',' done My problem is this possible output one.txt ... (2 Replies)
Discussion started by: popeye
2 Replies

8. UNIX for Advanced & Expert Users

Dot sourcing differences in ksh, AIX vs Linux vs Solaris

Why does dot sourcing of ksh functions behave so differently between AIX, Solaris, and Linux? How can I make Linux behave the way I want in the test I show below? I have a library of interdependent functions I have developed and use in ksh in AIX. They also run in Solaris. Now I am migrating... (9 Replies)
Discussion started by: charles_n_may
9 Replies

9. Shell Programming and Scripting

2 lists, show differences plus or minus

Not really sure how to accomplish this. If I have two lists with matching columns. Second column is different. I would like to show the differences plus/minus. list1 device1 5 decive2 10 decive3 10 device4 10 device5 10 device6 20 list2 device1 10 ... (1 Reply)
Discussion started by: mrlayance
1 Replies

10. Shell Programming and Scripting

Sed/awk to tell differences between two lists

Greetings all, I have two output lists from a log that I am working with. Below are the examples. except, the lists are in the thousands. list1.out FEA1234 FEA4343 FEA3453 FEA3413 FEA34A3 FEA3433 .... list2.out FEA1235 (3 Replies)
Discussion started by: jeffs42885
3 Replies
FormValidator::Simple::Results(3pm)			User Contributed Perl Documentation		       FormValidator::Simple::Results(3pm)

NAME
FormValidator::Simple::Results - results of validation SYNOPSIS
my $results = FormValidator::Simple->check( $req => [ name => [qw/NOT_BLANK ASCII/, [qw/LENGTH 0 10/] ], email => [qw/NOT_BLANK EMAIL_LOOSE/, [qw/LENGTH 0 30/] ], ] ); if ( $results->has_error ) { foreach my $key ( @{ $results->error() } ) { foreach my $type ( @{ $results->erorr($key) } ) { print "invalid: $key - $type "; } } } DESCRIPTION
This is for handling resuls of FormValidator::Simple's check. This object behaves like Data::FormValidator's results object, but has some specific methods. CHECK RESULT
has_missing If there are missing values ( failed in validation 'NOT_BLANK' ), this method returns true. if ( $results->has_missing ) { ... } has_invalid If there are invalid values ( failed in some validations except 'NOT_BLANK' ), this method returns true. if ( $results->has_invalid ) { ... } has_error If there are missing or invalid values, this method returns true. if ( $results->has_error ) { ... } success inverse of has_error unless ( $resuls->success ) { ... } ANALYZING RESULTS
missing no argument When you call this method with no argument, it returns keys failed 'NOT_BLANK' validation. my $missings = $results->missing; foreach my $missing_data ( @$missings ) { print $missing_data, " "; } # -- print out, for example -- # name # email key When you call this method with key-name, it returnes true if the value of the key is missing. if ( $results->missing('name') ) { print "name is empty! "; } invalid no argument When you call this method with no argument, it returns keys that failed some validation except 'NOT_BLANK'. my $invalids = $results->invalid; foreach my $invalid_data ( @$invalids ) { print $invalid_data, " "; } # -- print out, for example -- # name # email key When you call this method with key-name, it returns names of failed validation. my $failed_validations = $results->invalid('name'); foreach my $validation ( @$failed_validations ) { print $validation, " "; } # -- print out, for example -- # ASCII # LENGTH key and validation-name When you call this method with key-name, it returns false if the value has passed the validation. if ( $results->invalid( name => 'LENGTH' ) ) { print "name is wrong length! "; } error This doesn't distinguish 'missing' and 'invalid'. You can use this like 'invalid' method, but this consider 'NOT_BLANK' same as other validations. my $error_keys = $results->error; my $failed_validation = $resuls->error('name'); # this includes 'NOT_BLANK' if ( $results->error( name => 'NOT_BLANK' ) ) { print "name is missing! "; } if ( $results->error( name => 'ASCII' ) ) { print "name should be ascii code! "; } SEE ALSO
FormValidator::Simple AUTHOR
Lyo Kato <lyo.kato@gmail.com> COPYRIGHT AND LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself. perl v5.14.2 2011-12-08 FormValidator::Simple::Results(3pm)
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy