date -f
tells it to do the same thing as -d
except for every line in a file... you can set the filename to -
to make it read from standard input.
echo "yesterday" | date +"%d %m %Y" -f -
Yes.
echo "yesterday" | xargs date +"%d %m %Y" -d
You can use `command`
or $(command)
substitution:
date +"%d %m %Y" -d $(echo "yesterday")
Just to throw it in, in bash:
date +"%d %m %Y" -f <(echo yesterday)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With