cp $var1 var2 doesn't work
I'm running a bash script on a Raspberry Pi to control LED pixels. I'm stuck on a basic copy command.
I have a variable called nexttemp which contains the string B_254_TieDyeKaleidoscope.fseq
That file, in the same directory, is a large binary file that I'm trying to copy to a file called MasterFseq.fseq
If I do a
cp nexttemp MasterFseq.fseq
then MasterFseq.fseq contains the B_254_TieDyeKaleidoscope.fseq file name.
I want instead to have copied the binary file to MasterFseq.fseq.
It's my understanding that a $nexttemp will point to the binary file and not the name of it but when I do a
cp $nexttemp MasterFseq.fseq
the $nexttemp is thrown away and I'm told there is no destination file name, eg.
root@FPP:/home/pi/media/sequences# echo cp $nexttemp MasterFseq.fseq
+ echo cp MasterFseq.fseq
How do I get the binaray file, which is named in nexttemp, copied to MasterFseq.fseq?