diff --git a/plugins/sh/src/com/intellij/sh/run/ShRunConfigurationProfileState.java b/plugins/sh/src/com/intellij/sh/run/ShRunConfigurationProfileState.java index 3eec60257fdb..7212c09b057a 100644 --- a/plugins/sh/src/com/intellij/sh/run/ShRunConfigurationProfileState.java +++ b/plugins/sh/src/com/intellij/sh/run/ShRunConfigurationProfileState.java @@ -209,9 +209,12 @@ final class ShRunConfigurationProfileState implements RunProfileState { String escapedValue = StringUtil.escapeQuotes(value); quotedString = StringUtil.containsWhitespaces(value) ? StringUtil.QUOTER.apply(escapedValue) : escapedValue; } - if (endWithSemicolon && index == envs.size() - 1) { - commandLine.add(key + "=" + quotedString + ";"); - } else { + if (endWithSemicolon) { + String semicolon = ""; + if (index == envs.size() - 1) semicolon = ";"; + commandLine.add("export " + key + "=" + quotedString + semicolon); + } + else { commandLine.add(key + "=" + quotedString); } index++;