I have zero access to the bash profile file on any of these commercial shell
services.
On Sun, 17 May 2026, John Hasler wrote:
Copy the script below to your home directory on your shell server.
I call the script "findbetween" but you can rename it if you wish.
Run this command:
chmod a+x findbetween
Run this command:
alias findbetween="$HOME/findbetween"
Typing findbetween should now print a usage message.
Adding the above command to the end of the .bash_profile file in
your home directory should make the change permanent.
-----NEXT LINE IS FIRST LINE OF THE SCRIPT----
#!/bin/bash
# This program is free software. You may treat it as if it were
# in the public domain. You are free to make and distribute copies
# and derivatives. John Hasler 2026-05-17
if [ "$#" -ne 2 ]; then
cat <<EOF
This program lists files in the current directory that are newer or as new as
the first date on the command line but no newer than the second one.
The dates must be in ISO standard form (without seconds) and in single quotes.
The exact format is important. Note the leading zeros.
Example:
'2026-05-12 09:41' '2026-05-16 20:52'
EOF
exit 1
fi
startdate=$1
enddate=$2
export startdate
export enddate
ls -tuo --full-time | awk '
{start = ENVIRON["startdate"]}
{end = ENVIRON["enddate"]}
{date = $5 " " substr($6, 1, 5)}
{if (date >= start && date <= end) print date " " $8 }
'
-----PREVIOUS LINE IS THE LAST LINE OF THE SCRIPT----
Note that the last line of the script contains only
a single "'".
--
John Hasler
[email protected]
Elmwood, WI USA