bash имеет встроенная переменная таймера
start=$SECONDS
# do stuff
end=$SECONDS
duration=$(( end - start ))
echo "stuff took $duration seconds to complete"
cat
будет следовать порядку аргументов, если вы развернете ~ / foo *
(в некоторых оболочках двойной табуляции или echo ~ / foo *
) вы увидите порядок.
Подстановочный знак *
имеет алфавитный порядок.
SO глобальный вопрос: https://superuser.com/questions/192280/does-bashs-match-files-in-alphanumeric-order
Из man bash
:
After word splitting, unless the -f option has been set, bash scans
each word for the characters *, ?, and [. If one of these characters
appears, then the word is regarded as a pattern, and replaced with an
*alphabetically* sorted list of filenames matching the pattern
Обратите внимание на в алфавитном порядке
. В вашем случае это будет:
$ cat foo.0001.0010 foo.0011.0020 foo.0021.0030
Вы можете расширить *
с помощью C - x * после ввода *
и перед нажатием введите .