I'm looking to add a time stamp or just the date to a file name once it has been downloaded from a remote server using a curl command. I know you can use -o to specify what you want to name the file. I have seen suggestions like: -o "somefile $(date +\"%H:%M\").txt" to try to achieve this but I can't quite get it working, it just saves the file as 'somefile $(date' like it doesn't recognize $ as a variable.
Does anyone know of a way to achieve this using curl or if it is possible?
Is there another way to create a variable with the date and then append it onto the file name?
Thanks in advance.
-o 'some file $(date +"%H:%M").txt'would produce the behavior you describe.