If the dates are not sorted and if you have GNU date than you could this I suppose:
Code:
#!/bin/ksh
typeset -A A
typeset -A D
while IFS="|" read city field2 tdate field4 key ; do
newdate=$(date -d "$tdate" '+%s')
if [ $newdate -gt "${D[$key]}" ]; then
A[$key]="$city|$field2|$tdate|$field4|$key"
D[$key]=$newdate
fi
done < infile126
for i in "${A[@]}"; do
echo "$i"
done|sort -t'|' -k5,5
hello,
how can I filter and get the latest order number (last five digits) below:
input file:
johnmm00001
maryyy00121
johnm100222
johnmm00003
maryyy00122
output file:
johnmm00003
maryyy00122
johnm100222 (6 Replies)
Anyone can help for filter the uniq record for below example? Thank you very much
Input file
20090503011111|test|abc
20090503011112|tet1|abc|def
20090503011112|test1|bcd|def
20090503011131|abc|abc
20090503011131|bbc|bcd
20090503011152|bcd|abc
20090503011151|abc|abc... (8 Replies)
Reposting since I didnt not get any reply.
I have a problem while filtering records from a file. Can somebody help please?
For eg: Consider the below files
Record file:
0003@00000000000190@20100401@201004012010040120100401@003@... (1 Reply)
Hello all!! I am new here and new in scripting!
I want to write a ksh script to select the most recent file from a dir and use it in a variable.
I have a directory with files named like: YYYMMDD
A basic idea of the script I want to write is
#!/usr/bin/ksh
latest= latest_dated_file at... (2 Replies)
Hi,
I need a ksh script for the below requirement:
i have a Delimited flat file with 200 records delimiter is '|~|'
i need a script to insert space at the end if the record is ending with delimiter '|~|'
if it didnt end with delimiter it should not append space.
Example: ram|~|2|~| ... (16 Replies)
Dear friend,
I have a file 2 files with column wise
FILE_A
------------------------------
x,1,@
y,3,$
x,5,%
FILE_B
--------------------
x,1,@
i like to delete the all lines in FILE_A ,if first column available in FILE_B.
output (in FILE_A)
y,3,$
x,5,% (10 Replies)
Dear All,
I have getting data as follows, the second field signifies table name and last one is time stamp. I have return always latest record based on time stamp. Could you please help me ?
I/P
====
... (1 Reply)
Using ksh, I am using SQLPlus to execute a query with a filter using a string variable.
REPO_DB=DEV1
FOLDER_NM='U_nmalencia'
FOLDER_CHECK=$(sqlplus -s /nolog <<EOF
CONNECT user/pswd_select@${REPO_DB}
set echo off heading off feedback off
select subj_name
from subject
where... (5 Replies)
I have requirement to print latest record from file based on multiple columns combination.
EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/16/2015 100004 03/16/2015 100005 001
EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 140003 03/18/2015 140004 001
EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 220006... (1 Reply)
Discussion started by: tmalik79
1 Replies
LEARN ABOUT ULTRIX
kdb_edit
kdb_edit(8krb)kdb_edit(8krb)Name
kdb_edit - Kerberos database editing utility
Syntax
/var/dss/kerberos/bin/kdb_edit [-n]
Description
You use the command to create or change principals stored in the Kerberos database. When you invoke kdb_edit, the command prompts you for
the Kerberos database master key and verifies that the key is the same as the master key of the Kerberos database. If the -n option is
used, the key is fetched from the master key file.
Once the master key is verified, kdb_edit begins a loop that prompts you for the principal and instance name to modify. If kdb_edit does
not find an entry, you can create one. Once kdb_edit finds or creates an entry, you can set the password, expiration date, maximum ticket
lifetime, and attributes of a principal.
The kdb_edit command displays, in brackets, the default values for the expiration dates, maximum ticket lifetimes, and attributes. You can
select any default by pressing the return key. The kdb_edit command indicates that you have successfully created or changed an entry by
displaying the message, "Edit O.K."
There is no default password for a principal. However, if you enter RANDOM as the password for a principal, kdb_edit selects a random Data
Encryption Standard (DES) key for the principal.
Whenever the Kerberos database is changed by the modification time of is updated. The file indicates the age of the database.
Options-n If you specify the command with the -n option, kdb_edit fetches the key from the master key file.
Files
See Also
kdb_init(8krb), kstash(8krb), kdb_util(8krb), kdb_destroy(8krb)kdb_edit(8krb)