Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!rpi!rpi.edu!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: comp.unix.questions Subject: Re: File Modification Dates Message-ID: Date: 11 May 89 02:17:29 GMT References: <207@psgdc> Sender: usenet@rpi.edu Reply-To: tale@pawl.rpi.edu Distribution: comp Lines: 39 In article <207@psgdc>, rg@psgdc (Dick Gill) writes: [wants code to get readable modtime from filename] Dick> I'll be happy to get a C program, shellscript or anything else Dick> that I can call from a Bourne shell script. In addition to Jonathan's modtime programme and Randal's perl script, there is also "sls", available in the comp.unix.sources archives. I like sls a lot for scripts because I can choose my format string very easily rather than pull apart the lines generated by a standard ls -l. Examples: Script started on Wed May 10 22:07:52 1989 (blank lines added for clarity in reading) imagine:tale (1) ls -dl emacs drwxr-xr-x 2 tale 512 May 4 14:28 emacs imagine:tale (2) sls -dl emacs drwxr-xr-x 2 tale 512 May 04 1989 14:28 emacs imagine:tale (3) sls -dp %a emacs May 09 1989 19:54 imagine:tale (4) sls -dp '%n: %c"%h %d"' {emacs,bin,src} bin: Apr 27 emacs: May 04 src: May 10 imagine:tale (5) exit script done on Wed May 10 22:09:04 1989 That was just extremely simple stuff, but that's what is great about sls ... it's fast and it can do complex formatting or simple formatting, all depending on your needs. Dave -- tale@rpitsmts.bitnet, tale%mts@itsgw.rpi.edu, tale@pawl.rpi.edu