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 functiontimestamp() {  date +%D-%T | tr :/ -}# Define the file namevalue=$(timestamp)filename= /home/pi/media/$value.h264#Recordingraspivid -w 800 -h 600 -t 15000 -o $filename -n -rot 270#Terminate the scriptexit
What I am doing wrong with this bash variable?
bash;shell
Why first assign the timestamp to value? You can just do:filename=/home/pi/media/$(timestamp).h264And you should quote the filename in the recording command (in case there are spaces in the path, etc.):#Recordingraspivid -w 800 -h 600 -t 15000 -o $filename -n -rot 270