Afficher un message
Vieux 26/08/2006, 21h05   #9
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: put find output in an array

2006-08-26, 13:15(-04), kenneth kahn:
[...]
> If you use somthing like KSH93 or equivalent, you can do
>
> set -A files 0 $(find . -mtime ${maxTime})


ITYM

IFS=$'\n'
set -f
set -A files 0 $(find . -mtime "$maxTime" -print)

which is slightly better but not correct yet.

You need GNU find and zsh for the task.

IFS=$'\0'
files=($(find . -mtime $maxTime -print0))

or simply as zsh has find functionality builtin:

files=(./**/*(ND.m$maxTime))

--
Stéphane
  Réponse avec citation
 
Page generated in 0,05161 seconds with 9 queries