Sponsored Content
Top Forums Shell Programming and Scripting How to sort a set of files by date in a directory? Post 302296888 by alexf on Thursday 12th of March 2009 05:45:27 AM
Old 03-12-2009
what would this look like in PERL though ?
 

10 More Discussions You Might Find Interesting

1. AIX

loop through the directory for files and sort by date and process the first file

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

2. Linux

sort files by date

Hi All, Sorry to throw this frequent question but I lost my notes on it. How do you list the files by date? I'm on red hat. Thanks in advance, itik (1 Reply)
Discussion started by: itik
1 Replies

3. UNIX for Dummies Questions & Answers

Sort files by date, not showing files from today

Hi all, i'm new here in this forum. I really like the helpful answers in this forum. Here a short question. For a script i have to sort files by date and exclude the files of the actual date. Sorting the files by date and preparing the output for awk is done by this line: ls -l... (3 Replies)
Discussion started by: carlosdivega
3 Replies

4. Shell Programming and Scripting

How to Sort files on date field

:cool: Hi all, I have a pecular issue in sorting these files in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date column (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (4 Replies)
Discussion started by: shivaastrogun
4 Replies

5. Shell Programming and Scripting

Creating date directory and moving files into that directory

I have list of files named file_username_051208_025233.log. Here 051208 is the date and 025233 is the time.I have to run thousands of files daily.I want to put all the files depending on the date of running into a date directory.Suppose if we run files today they should put into 05:Dec:08... (3 Replies)
Discussion started by: ravi030
3 Replies

6. Shell Programming and Scripting

Sort files by date in filename

Hi, I am a newbie to shell programming and I need some help in sorting a list of files in ascending order of date in the filenames. The file format is always : IGL01_AC_D_<YYYYMMDD>_N01_01 For example, in a directory MyDirectory I have the following files: IGL01_AC_D_20110712_N01_01.dat... (11 Replies)
Discussion started by: Yuggy
11 Replies

7. Shell Programming and Scripting

To get the files in a directory for the given date (User entered date)

Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user. For example if a directory contains files as below : > ll total 41 -rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh -rw-rw-r-- 1 psn psn ... (10 Replies)
Discussion started by: ramprabhum
10 Replies

8. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies

9. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

10. UNIX for Beginners Questions & Answers

How to sort files in directory numerically?

Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine. I have a directory that has... backup.bk1 backup.bk100 backup.bk2 backup.bk200 backup.bk3 backup.bk300 There are a lot more files but this is shortened for the... (5 Replies)
Discussion started by: c3rb3rus
5 Replies
parent(3)						User Contributed Perl Documentation						 parent(3)

NAME
parent - Establish an ISA relationship with base classes at compile time SYNOPSIS
package Baz; use parent qw(Foo Bar); DESCRIPTION
Allows you to both load one or more modules, while setting up inheritance from those modules at the same time. Mostly similar in effect to package Baz; BEGIN { require Foo; require Bar; push @ISA, qw(Foo Bar); } By default, every base class needs to live in a file of its own. If you want to have a subclass and its parent class in the same file, you can tell "parent" not to load any modules by using the "-norequire" switch: package Foo; sub exclaim { "I CAN HAS PERL" } package DoesNotLoadFooBar; use parent -norequire, 'Foo', 'Bar'; # will not go looking for Foo.pm or Bar.pm This is equivalent to the following code: package Foo; sub exclaim { "I CAN HAS PERL" } package DoesNotLoadFooBar; push @DoesNotLoadFooBar::ISA, 'Foo', 'Bar'; This is also helpful for the case where a package lives within a differently named file: package MyHash; use Tie::Hash; use parent -norequire, 'Tie::StdHash'; This is equivalent to the following code: package MyHash; require Tie::Hash; push @ISA, 'Tie::StdHash'; If you want to load a subclass from a file that "require" would not consider an eligible filename (that is, it does not end in either ".pm" or ".pmc"), use the following code: package MySecondPlugin; require './plugins/custom.plugin'; # contains Plugin::Custom use parent -norequire, 'Plugin::Custom'; DIAGNOSTICS
Class 'Foo' tried to inherit from itself Attempting to inherit from yourself generates a warning. package Foo; use parent 'Foo'; HISTORY
This module was forked from base to remove the cruft that had accumulated in it. CAVEATS
SEE ALSO
base AUTHORS AND CONTRIBUTORS
Rafaeel Garcia-Suarez, Bart Lateur, Max Maischein, Anno Siegel, Michael Schwern MAINTAINER
Max Maischein " corion@cpan.org " Copyright (c) 2007-10 Max Maischein "<corion@cpan.org>" Based on the idea of "base.pm", which was introduced with Perl 5.004_04. LICENSE
This module is released under the same terms as Perl itself. perl v5.16.3 2011-03-08 parent(3)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy