toolkit/func/core/pkg_coreutils/21-touch-ls.sh

14 lines
368 B
Bash
Raw Normal View History

2021-07-05 06:50:25 +00:00
#!/bin/bash
r_log "coreutils" "Testing touch and ls"
2023-11-21 08:23:44 +00:00
trap '/bin/rm /tmp/touch-?' EXIT
2021-07-05 06:50:25 +00:00
r_log "coreutils" "Touch files with specific dates"
touch -t 199104230420 /tmp/touch-1
touch -t 199104240420 /tmp/touch-2
r_log "coreutils" "Verify that the oldest file is last"
2021-07-06 20:16:01 +00:00
# shellcheck disable=SC2012
2021-07-05 06:50:25 +00:00
ls -lt /tmp/touch-? | tail -n 1 | grep -q 'touch-1'
r_checkExitStatus $?