1

I'd like to have a newline character in an environment variable. I've tried

SetEnv DI_collection_clients_list "client1
client2"

which results in

Invalid command 'client2"', perhaps misspelled or defined by a module not included in the server configuration

when restarting Apache.

I've also tried

SetEnv DI_collection_clients_list "client1\nclient2"

which results in the variable of course having a \n instead of a newline.

Colin Dean
  • 121
  • 4

1 Answers1

1

The setenv directive is part of mod_env.c which uses the apr function apr_table_setn to store the environment variables in a table. If you look at the source code you'll see that the table just stores the data that is passed to it without any character expansion.

Whatever it is you're trying to do, trying to do it this way is almost certainly wrong.

user9517
  • 115,471
  • 20
  • 215
  • 297