I googled and googled, and nowhere could I find any help or related posts to my question...
How do I specify a file that has just been timestamped within a bash script? Thank you very much for your time.
Basic Example:
#!/bin/sh
touch $(date +'%Y-%m-%d_%H-%M-%S').log
program --start --output /home/user/.logs/the_above_timestamped_file.log
Precise Example:
The below code is a non-working bash script, no success of the program writing to the timestamped log file, or the program can't find the timestamped log file? Or perhaps it doesn't know which file to write to since the timestamped file is one of many within the directory of logs. Wish I knew how to figure this out...
#!/bin/sh
# start the logkeys service
# create a timestamped file
# append key logging to that file
LOG_FILE_NAME=$(date +'%Y-%m-%d_%H-%M-%S')_key.log
touch "/mnt/WDRED6TBHDD/text/keylog/$LOG_FILE_NAME"
sudo logkeys --start --output "/mnt/WDRED6TBHDD/text/keylog/$LOG_FILE_NAME"