cp: missing destination file operand after

bash, terminal, unix

Solution

Variable assignments in bash scripts require no space between the variable name and value or (unless quoted) within the value. Since a space was present in the line `FILEBACKUPLOCATION= /../.../FMonday`, it attempted to execute `/../.../FMonday` as a command (which caused the first error) with `FILEBACKUPLOCATION` assigned to an empty string. The variable was then not assigned when the other command further down tried to use it (accounting for the second error).

Problem

Im trying to do a full back up and copy over all files from one directory into another directory ``` #!/bin/bash #getting files from this directory PROJECTDIRECTORY=/../../Project3 #Copied to this directory FILEBACKUPLOCATION= /../.../FMonday for FILENAME in $PROJECTDIRECTORY/* do cp $FILENAME $FILEBACKUPLOCATION done ``` But I keep getting this error ``` ./fullbackup: line 6: /../../FMonday: Is a directory cp: missing destination file operand after ```

Original source