diff --git a/otelcollector/shared/process_utilities.go b/otelcollector/shared/process_utilities.go index b97efd5f6..63d1421cd 100644 --- a/otelcollector/shared/process_utilities.go +++ b/otelcollector/shared/process_utilities.go @@ -72,7 +72,7 @@ func SetEnvAndSourceBashrc(key, value string, echo bool) error { defer file.Close() // Write the export statement to the .bashrc file - _, err = fmt.Fprintf(file, "export %s=%s\n", key, value) + _, err = fmt.Fprintf(file, "export %s=\"%s\"\n", key, value) if err != nil { return fmt.Errorf("failed to write to .bashrc file: %v", err) }