[Shell] Fixed 'cp' command logic to allow files copying to the same directory.