zshell: cp the last file in a given directory

in code

It’s come in useful for some small tasks.

cp-last() {
    if [[ -d "$1" ]]; then
        echo "cd: ${1}: Not a directory"
        exit 1

    cp "${1}/$(ls -A1t $1 | head -n 1)" "${2}"

Remap a JavaScript Object

in code

Blog Silence

in me

Run Clare 2019 Race Series

in running

Your email address will not be published. Required fields are marked *