Files
scripts/today.sh
T
2026-09-29 15:24:09 -04:00

22 lines
443 B
Bash
Executable File

#!/usr/bin/env sh
# Exit if any command fails and enable tracing
set -ex
# Get today's date in the format YYYY-MM-DD
today=$(date +"%Y-%m-%d")
# Create a path to today's temp folder and then make sure the folder exists
temp_path="/tmp/${today}"
mkdir -p "${temp_path}"
# Now make a symlink to the folder in your homedir
ln -sf "${temp_path}" "${HOME}/today"
# Disable tracing
set +x
# Write out the path you created
echo "${temp_path}"