Afficher un message
Vieux 25/08/2006, 13h06   #2
Stephan 'smg' Grein
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: put find output in an array

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

johnmmcparland wrote:
> Hi all,
>
> I have a script which finds all the files edited x days ago.
>
> Having found these files, I wish to loop round them, check their name,
> and if they do not have the same name as the script, remove them.
>
> My probelm is once I've executed the find command;
>
> find . -mtime ${maxTime}
>
> how do I get this into an array?


You don't need that.
find . -mtime ${maxTime} -exec echo {} \;
>
> After this I would do something like
>
> for f in $array
> do
> ....
> done
>
> where $array is the array containing the find output
>
> thanks
>

np

- --
Stephan 'smg' Grein, <stephan at stephan minus rockt dot de>
https://stephangrein.de
GnuPG-Key-ID: 0xF8C275D4
FingerPrint: 5B6F 134A 189B A24D 342B 0961 8D4B 0230 F8C2 75D4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iQIVAwUBRO7ZsI1LAjD4wnXUAQIh4w/9H1Z2WQSf2bHa9QtI9FYVWrHc4r84QtFb
BQREyevHDWlxrDFgv3vhd3tKIgHWmSdvpmrrCUSqPXISrlkxG/1ny26YXYXeJ5/U
VydPuBKJG4Olvwl8InPeRlVXioa2fvLAFKd4RmXANW0rZlmB5t vPsmfG8qIIhQpx
9Lbz47Ox7j9r3Vft+7pnpM+zraCbMsNOmChDrC/h9G5tBbhvo34PjReNXhZsR0EQ
emqbDzmm0xYn/dpJTrEi4yNWEVbenZFns4Kt+VSu1bCa3jdfLtiJ7Lpr1Y1cHfD 5
xjOB8RuGULKFM1x+l5sBhcpfjEWUm1+nMX23c/iHcehkPhpN1KTSatHJxdH8x1Xk
2CGqMPMOvZIZSS8gR2KFGdBhWZZKsE6lqexo3xAe6gaCpYGSVm 7Rr+epl6dE2l6d
NHC+CZ3voiTtAAFPN/mPKX+JtaZ0UVOFdC0npj7+3AoLnkdGwZROjazfYzRFmz7C
d7sG6wI9plYx+MJXNCjxPJ0rvaZHvHw3duEIQpk87vZdgLvQNN A/bhnmH9hgw5Wa
5eRkH5nPaCJRJmazbM7YEJodqQW8RAvqFP5Rjp4cy7Kx6cEnNs 7gu87WMF+IDibV
ivmDFhj9i+q9MQu9aR8irNaLDt6PGeLOQVU/xnedp6gq/8HK9jRzwrqwJKKt6OgL
APMIhUcSoz4=
=zar6
-----END PGP SIGNATURE-----
  Réponse avec citation
 
Page generated in 0,05940 seconds with 9 queries