in reply to Re: •Re: Keeping only the $n newest files/directories in a diretory?
in thread Keeping only the $n newest files/directories in a diretory?
That's the Schwartzian Transform. I goes something like this:
</var/script/proc/*> will glob and return the list of file/directories in that folder.So in short, you get the list of folders, you build an array of arrays containing the folder name and the modification date, you sort by the modification date, and return only the folder names to use.
Update: :)
|
|---|