I know how to run a simple command inside another command, but in my case is special.
My command contain "
. (date "+%Y-%m-%d"
)
I need to display my log via 1 command
If I do this date "+%Y-%m-%d"
I will get 2020-06-03
I want to pass that command into another command like this :
tail -f /Users/jdoe/Sites/laravel7/storage/logs/laravel-"date "+%Y-%m-%d"".log
I can't to get it working.
How do I do it ?
To run this command
tail -f /Users/jdoe/Sites/laravel7/storage/logs/laravel-2020-06-03.log
This is called command substitution
tail -f /Users/jdoe/Sites/laravel7/storage/logs/laravel-$(date "+%Y-%m-%d").log
An older deprecated syntax uses backticks
tail -f /Users/jdoe/Sites/laravel7/storage/logs/laravel-`date "+%Y-%m-%d"`.log