02-08-2010
script to find filenames with latest version and for all seq. numbers in a day
Hi,
We have a requirement to find the set of filenames from the group of files in a specified folder based on
(i) version number
(ii) sequence number
such that, for any given sequence number in a day only the latest version filenames have to indentified.
Below is the format of the file
<HUB>_<FEED_NAME>_<DATE>_<SEQUENCE_NUM>_<VERSION_NUM>.pgp
Hence if the folder has files namely
- dummy_feed_02022010_1_1.pgp
- dummy_feed_02022010_1_2.pgp
- dummy_feed_02022010_1_3.pgp
- dummy_feed_02022010_2_2.pgp
-dummy_feed_01022010_1_1.pgp
In the above case, if the shell script is run on 2 nd feb assuming, it should pick files for that day with all sequence numbers but only the latest versions.
here, the shell script should return
dummy_feed_02022010_1_3.pgp
dummy_feed_02022010_2_2.pgp
Please help me out how to get this done using a shell script. Let me know if you need more details.
Thanks
Deepak
Last edited by pludi; 02-08-2010 at 03:07 AM..
Reason: sanitized formatting
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to buy it (2 Replies)
Discussion started by: LANSTARR.COM
2 Replies
2. Shell Programming and Scripting
Hi ,
I am relatively new to unix...
Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell..
This is very urgent.
Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
3. Shell Programming and Scripting
i have a directory in which there are executable files and these files are added at runtime. now i need a shell script which will be called at a certain interval. this shell script should find the latest executable file in that directory and start that executable. care should be taken that once the... (6 Replies)
Discussion started by: kvineeth
6 Replies
4. Shell Programming and Scripting
Hi everyone,
Please help:)
I have a list of 1000 different files which comes daily to the directory.Some of
the files are not coming to the directory now.
I need to write a shell script to find the latest date and time of the files they
came to the directory. The files should be unique.... (1 Reply)
Discussion started by: karthicss
1 Replies
5. Shell Programming and Scripting
Hi All,
I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this.
My Requirment is as below:
Input for me will be 2000909(YYYYMM)
I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies
6. Shell Programming and Scripting
Hello All,
I need a bash shell script to find out a day from the date.For example we give the date(20100227/YYYYMMDD) then we get the day 'Saturday'.
Thanks in advance,
Satheesh (5 Replies)
Discussion started by: satheesh4093
5 Replies
7. Fedora
I try to find the first day of our calender. So I used this script ...
echo -n "The week of the date 01jan0001 : "
echo -n `date -d 00010101 +%A`
echo
But its shows error
bash-3.1$ sh first_day.shThe week of the date 01jan0001 : date: invalid date `00010101' (3 Replies)
Discussion started by: krishnampkkm
3 Replies
8. Shell Programming and Scripting
Hi, I need help to convert the filenames of my 9-year daily files (1999-2007) from a julian day to yyyy-mm-dd format. my original files are patterned likes the ones below.
1999001.txt
1999002.txt
1999003.txt
1999004.txt ...
1999365.txt
desired output:
19990101.txt
19990102.txt... (3 Replies)
Discussion started by: ida1215
3 Replies
9. Shell Programming and Scripting
Hi Experts,
i am using the below code get the date of previous day.
#!/usr/bin/ksh
datestamp=`date '+%Y%m%d'`
yest=$((datestamp -1))
echo $yest
When i execute the code i am getting output as:
20130715
What i am trying here is, based on the date passed i am fetching previus day's... (0 Replies)
Discussion started by: learner24
0 Replies
10. Shell Programming and Scripting
I have a below file
FILE.cfg
JAN_01
VAR1=4
VAR2=SUM
VAR3=PRIVATE
JAN_10
VAR1=44
VAR2=GUN
VAR3=NATUR
JAN_20
VAR1=3
VAR2=TQN
VAR3=COMMA
code: (JAN_10 is argument passed from script) (6 Replies)
Discussion started by: Roozo
6 Replies
LEARN ABOUT SUSE
perl-nocem
PERL-NOCEM(8) InterNetNews Documentation PERL-NOCEM(8)
NAME
perl-nocem - A NoCeM-on-spool implementation for INN 2.x
SYNOPSIS
perl-nocem
DESCRIPTION
NoCeM, which is pronounced No See 'Em, is a protocol enabling authenticated third-parties to issue notices which can be used to cancel
unwanted articles (like spam and articles in moderated newsgroups which were not approved by their moderators). It can also be used by
readers as a third-party killfile. It is intended to eventually replace the protocol for third-party cancel messages.
perl-nocem processes third-party, PGP-signed article cancellation notices. It is possible not to honour all NoCeM notices but only those
which are sent by people whom you trust (that is to say if you trust the PGP key they use to sign their NoCeM notices). Indeed, it is up
to you to decide whether you wish to honour their notices, depending on the criteria they use.
Processing NoCeM notices is easy to set up:
1. Import the keys of the NoCeM issuers you trust in order to check the authenticity of their notices. You can do:
gpg --no-default-keyring --primary-keyring <pathetc>/pgp/ncmring.gpg --import <key-file>
where <pathetc> is the value of the pathetc parameter set in inn.conf and <key-file> the file containing the key(s) to import. The
keyring must be located in <pathetc>/pgp/ncmring.gpg; you only have to create the directory <pathetc>/pgp before using gpg (it will
automatically generate the ncmring.gpg file). For old PGP-generated keys, you may have to use --allow-non-selfsigned-uid if they are
not properly self-signed, but anyone creating a key really should self-sign the key. Current PGP implementations do this
automatically.
The keys of NoCeM issuers can be found in the web site of The NoCeM Registry: <http://www.xs4all.nl/~rosalind/nocemreg/nocemreg.html>.
You can even download there a unique file which contains all the keys.
2. Create a nocem.ctl config file in pathetc indicating the NoCeM issuers and notices you want to follow. This permission file contains
lines like:
bleachbot@httrack.com:spam,site
pgpmoose@killfile.org:pgpmoose-forged-moderation
This will remove all articles for which the issuer (first part of the line, before the colon ":") has issued NoCeM notices
corresponding to the criteria specified after the colon.
You will also find information about that on the web site of The NoCeM Registry.
3. Add to the newsfeeds file an entry like this one in order to feed perl-nocem the NoCeM notices posted to alt.nocem.misc and
news.lists.filters:
nocem!
:!*,alt.nocem.misc,news.lists.filters
:Tc,Wf,Ap:<pathbin>/perl-nocem
with the correct path to perl-nocem, located in <pathbin>. Then, reload the newsfeeds file ("ctlinnd reload newsfeeds 'NoCeM channel
feed'").
Note that you should at least carry news.lists.filters on your news server (or other newsgroups where NoCeM notices are sent) if you
wish to process them.
4. Everything should now work. However, do not hesitate to manually test perl-nocem with a NoCeM notice, using:
grephistory '<Message-ID>' | perl-nocem
Indeed, perl-nocem expects tokens on its standard input, and grephistory can easily give it the token of a known article, thanks to its
Message-ID.
When you have verified that everything works, you can eventually turn off regular spam cancels, if you want, not processing any longer
cancels containing "cyberspam" in the Path: header (see the refusecybercancels parameter in inn.conf).
FILES
pathbin/perl-nocem
The Perl script itself used to process NoCeM notices.
pathetc/nocem.ctl
The configuration file which specifies the NoCeM notices to be processed.
pathetc/pgp/ncmring.gpg
The keyring which contains the public keys of trusted NoCeM issuers.
BUGS
The Subject: header is not checked for the @@NCM string and there is no check for the presence of the References: header.
The Newsgroups: pseudo header is not checked, but this can be done in local_want_cancel_id().
The Hierarchies: header is ignored.
HISTORY
Copyright 2000 by Miquel van Smoorenburg <miquels@cistron.nl>.
Copyright 2001 by Marco d'Itri <md@linux.it>.
$Id: perl-nocem.in 8539 2009-06-28 10:01:24Z iulius $
SEE ALSO
gpgv(1), grephistory(1), inn.conf(5), newsfeeds(5), pgp(1).
INN 2.5.2 2009-08-16 PERL-NOCEM(8)