Problem with carriage return in variables

  • Hi.

    I am testing a new installation of CloneDeploy under Ubuntu 16.04LTS. I have installed it using the tutorial, but changing some environment variables.

    I am still testing with USB Boot Method and I choose Winpe as environment (I didn't read enough and I thought it was the way to be for imaging Linux; now I know I can use Linux).

    That was my first testing settings, which ends in different errors.

    It seems that my $image_name and my $compression_algorithm variables ended with "\r", so some commands fails. (Of course, I have to do a lot of debugging to get to this conclusion, since "\r" is not a visible character XD)

    I have correct it changing line 52 in cd_global_functions:

    		for arg in "`parse_json "$checkInStatus" .TaskArguments`"; do case "$arg" in *=*) arg=$(echo $arg | sed -e 's/\r//g'); eval "$arg"; log "$arg"; esac; done

    Now it works for me.

    I think it is a problem with mono under apache generating unwanted "\r" in the web services response, but it is only an idea. I have not take a look to the server code.

    I hope this can help others with a similar problem.


  • That should not be necessary. I suspect that you were using an image with it's environment still set to winpe. You need to make sure your image's image environment matches the environment you are using.

    When a winpe image is created it sends the arguments with a "\r" at the end, if it's a linux image, it does not do that.

  • OK.
    Yes. I was using USB and suppose it is using Linux Environment.
    Now I understand how this work. I should haver read more about the environments.

    Thanks for the explanation.