String (@NotNull String shebang) { int index = shebang.indexOf(" "); @NonNls String possiblePath = index < 0 ? shebang : shebang.substring(0, index); if (!possiblePath.equals("/usr/bin/env")) return possiblePath; String interpreterPath = shebang.substring(index + 1); index = interpreterPath.indexOf(" "); return index < 0 ? interpreterPath : interpreterPath.substring(0, index); }