How can I insert a variable into a command? In the case below, I need to concatenate the command with the variable file name.
#!/bin/bash
# Define a timestamp function
timestamp() {
date +"%D-%T" | tr :/ -
}
# Define the file name
value=$(timestamp)
filename= "/home/pi/media/$value.h264"
#Recording
raspivid -w 800 -h 600 -t 15000 -o $filename -n -rot 270
#Terminate the script
exit
Aucun commentaire:
Enregistrer un commentaire