Skip to content
Advertisement

Why is my sed substitution with a & failing to execute?

I am trying to run following command on Linux Docker container but I am getting the following error:

JavaScript

The file content I am running it for:

JavaScript

I am doing it as suggested at – https://solveme.wordpress.com/2017/07/24/java-awt-awterror-assistive-technology-not-found-org-gnome-accessibility-atkwrapper-when-running-jasper-reports/

Can someone help me with it?

Advertisement

Answer

Just quote the command so & does not have an special meaning for Bash!

JavaScript

What is exactly happening here?

As read in man bash:

If a command is terminated by the control operator &, the shell executes the command in the background in a subshell.

Thus, when you say:

JavaScript

Bash is actually seeing two commands:

JavaScript

The first is sent to the background by &, so you get the message:

JavaScript

Then it evaluates it and determines it is incomplete, so it triggers the error:

JavaScript

Finally it shows how the background job has finished:

JavaScript

In the meanwhile, it tries to execute the command:

JavaScript

But fails miserably and hence it returns the error:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement