Pipe string to GNU Date for conversion - how to make it read from stdin?
Yes.
echo "yesterday" | xargs date +"%d %m %Y" -d
Just to throw it in, in bash:
date +"%d %m %Y" -f <(echo yesterday)
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 -
You can use `command`
or $(command)
substitution:
date +"%d %m %Y" -d $(echo "yesterday")