For 2 days old date I usually do this
echo $(date -v -2d)
What i am looking to do is something like this
n=5
echo $(date -v -nd)
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communitySolved it myself
n=5
echo $(date -v -${n}d)
$IFS
variable in shells like sh/bash
– Stéphane Chazelas
Sep 25 '19 at 13:53