8 lines
266 B
Bash
Executable file
8 lines
266 B
Bash
Executable file
#!/bin/bash
|
|
while read -r dir
|
|
do
|
|
echo "Checking dir '${dir}'..."
|
|
last_file="${dir}/$(ls -ht -- "${dir}" | head -n1)"
|
|
echo "Last modified file is '${last_file}'"
|
|
touch -r "${last_file}" -- "${dir}"
|
|
done <<< "$(find . -mindepth 1 -maxdepth 1 -type d)"
|