It's all about the answers!

Ask a question

Passing multiple commands to Command Line Build RTC 4.0.4 with Linux JBE

Jerry Feldman (12710) | asked May 16 '14, 11:13 a.m.
I have a command line build that works fine with a script, but I would like to possibly preprocess using a Linux command. So, for this example I want to invoke sed on the script, for instance:
/bin/sed 's/\r//g' | /bin/sh

or to accomplish the same thing:
dos2unix; ./

While this is just a simple case of converting the Windows line endings to Unix/Linux line endings there might be other things we may want to do on the build definition command line.

We do not use eclipse projects on our project, but our developers use either Linux or Windows for the RTC client.

Donald Nong commented May 18 '14, 8:34 p.m.

You can definitely use scripts on Linux. But what is your exact question?

One answer

permanent link
Jerry Feldman (12710) | answered May 19 '14, 8:36 a.m.
The problem is that windows users can cause the script to have Windows line engings (eg. CRLF). The CR will prevent BASH from executing the script.
The issue is the command line build. We use a script to do a maven build and perform some post-build tasks. The best solution I could think of is to use sed to eliminate the CRs and pipe it into bash (or sh). But the command-line build definition command line just ends up passing the pipe (or semicolon in the second example) to the first command.

There are other solutions, such as using the project explorer, but that does not ensure that the script will always have Linux line endings.

This is a minor issue since the developers who use Windows can also use some discipline.

Lily Wang commented May 20 '14, 3:33 a.m.

I did the test in my RTC 4.0.6. I don't think the JBE Command Line build can accept multiple commands.
For the Linux build, maybe you need another shell script to convert the file format and call the build script. You can even put the script on the build directory of the Linux build server.

Jerry Feldman commented May 20 '14, 7:50 a.m.

Thanks Lily,
It is a minor issue and a simple workaround. One possibility would be to use a Python script. I don't think the Python interpreter would have a problem.

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.