[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Leo Laursen <sslug@sslug>: > Her er et lidt kluntet forslag. > #!/bin/sh > files=($(find . -type f -print0 | xargs -0)) > echo ${files[$RANDOM % ${#files}]#*/} Hmmn. dårligt forslag. Jeg blev snydt af at ${#files} syntes at være korrekt; men vi er tilbage til at sh skiller på mellemrum.(space tab newline) Det virker vist rimeligt hvis IFS sættes til kun newline #v+ #!/bin/sh IFS=' ' array=($(find . -type f)) echo ${array[$RANDOM % ${#array}]#./} #v- Leo -- When a man knows he is to be hanged in a fortnight, it concentrates his mind wonderfully. -- Samuel Johnson
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |