12-03-2007
Loop through files in dir, omit file with latest date
I want to loop through files in a directory but omit the file with the latest date in my list of files. How would I accomplish this?
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I have a situation where I need to copy the files having the latest date.
For example I have a file by name bas100e1_jun05. I need to copy it to bas100e1. But when a file by name bas100e1_jul05 is put in the same directory the script should copy the file having the latest month which... (34 Replies)
Discussion started by: shashi_kiran_v
34 Replies
2. UNIX for Dummies Questions & Answers
Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Discussion started by: jee.ku2
1 Replies
3. AIX
hello
i have a requirement where i have a direcotry in which i get files in the format
STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat
i need to loop through the directory and sort by create date descending order and i need to process the first file.
... (1 Reply)
Discussion started by: dsdev_123
1 Replies
4. Shell Programming and Scripting
Hi,
I have below two situations to handle,
1. I have list of files with file names having date&time. I have to backup to old date files. say I have below files in a directory,
1. XX123_20101004010101.dat
2. XX124_20101004010201.dat
3. XX121_20101003010101.dat
4.... (6 Replies)
Discussion started by: smr_rashmy
6 Replies
5. UNIX for Dummies Questions & Answers
I am very new to unix as well as shell scripting.
I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file
Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies
6. Shell Programming and Scripting
Hi Everyone,
I am writing a shell script and I am struck here:
I need to find the latest file in a directory depending upon the date.
For example:
The files in the directory are:
Filename_bo_20110619
Filename_bo_20110620
Filename_bo_20110621
Filename_bo_20110622
So here, I want... (2 Replies)
Discussion started by: filter
2 Replies
7. UNIX for Dummies Questions & Answers
i have files like
1)20131112_abc_01.csv and
2)20131113_abc_01.csv and
3)20131113_abc_02.csv
when i try to fetch the file in the next day. it shud pick the third file..
plz help me..
and i use `date +"%Y%m%d"` command to fetch..it fetches the current date... (2 Replies)
Discussion started by: applepie
2 Replies
8. Shell Programming and Scripting
I have files in the ABC_YYYYMMDD.zip format under a directory. Each zip file contains A text file in the ABC_YYYYMMDD.txt format.
I am trying to create a script that will Rename the zip files and their underlying text file replacing the datepart in them with .
For eg: in the case of... (1 Reply)
Discussion started by: bash987
1 Replies
9. Shell Programming and Scripting
I believe there are couple of syntax issues in my script, couldn't find them :(
can someone help me with fixing it to make it work.
cd /abcde/
#get the latest filename excluding subdirs
filename=`ls -ltr | grep ^- | tail -1 | awk '{print $8}'`
#get system date and file timestamp and... (3 Replies)
Discussion started by: simpltyansh
3 Replies
10. Shell Programming and Scripting
Hello
I have 2 files, eg
more file1 file2
::::::::::::::
file1
::::::::::::::
1 fromfile1
2 fromfile1
3 fromfile1
4 fromfile1
5 fromfile1
6 fromfile1
7 fromfile1
::::::::::::::
file2
::::::::::::::
3 fromfile2
5 fromfile2 (4 Replies)
Discussion started by: CHoggarth
4 Replies
LEARN ABOUT CENTOS
ctxtools
CTXTOOLS(1) ConTeXt CTXTOOLS(1)
NAME
ctxtools - clean up temporary ConTeXt files, install latest ConTeXt
SYNOPSIS
ctxtools [ OPTION ... ]
DESCRIPTION
ctxtools is useful for dealing with ConTeXt source and generated files and for installing new versions of ConTeXt.
OPTIONS
--help Print the available options.
--purgefiles
Get rid of many temporary files generated by ConTeXt. You can give the --all option to remove a larger fraction of those files, and
the --recurse option to remove these files also in subdirectories.
--contextversion
Show the date of the ConTeXt macros and the format file. Useful after upgrading ConTeXt (perhaps using --updatecontext) to check
whether the new formats and macros are visible to the TeX path searches (see kpsewhich(1).
--updatecontext
Download the latest ConTeXt distribution and install it in the TEXMFLOCAL tree (see kpsewhich(1) for information on TeX path search-
ing). TEXMFLOCAL usually points to a system-wide location. If you want to install the new ConTeXt in your home directory (i.e. an
install for one user), then set the TEXMFLOCAL environment variable while running ctxtools. For example, using the syntax of the
Bourne shell sh(1):
TEXMFLOCAL=$HOME/texmf ctxtools --updatecontext
--documentation
Generate a .ted file from the source file. See also the --module option to texexec(1).
--patternfiles [languagecode]
Generate pattern files. You can also give the --all, --xml, and --utf8 options.
ENVIRONMENT
TEXMFLOCAL
Used by --updatecontext to decide where to install the distribution.
SEE ALSO
texexec(1), texmfstart(1).
ConTeXt wiki <http://www.contextgarden.net>.
BUGS
This manual page is not complete.
AUTHOR
This manual page was written by Sanjoy Mahajan <sanjoy@mit.edu>. It is in the public domain.
ctxtools 1.3.3 January 2007 CTXTOOLS(1)