I am trying to write a bash script to create a filename using some variables, I should add “-” character in some places to obtain the correct filepath. However when I use the following command, it turns me an empty space instead of – character:
FILEDIR=${root_path}${year}/${month}/${day}/${filename_zero}"_"${year}"-"${month}"-"${day}"-"${filename_one}
public/2024/03/18/105610_2024 03 18 12:33:42.mp4
The result that I need:
public/2024/03/18/105610_2024-03-18-12:33:42.mp4
I have tried many other things like single quote, non-quote, but it doesnt work…