Skip to content

Do not hardcode #!/bin/bash in shell scripts #25328

Closed
@mulander

Description

@mulander

Related to the BSD porting efforts ongoing in #10260.

BSD systems don't place bash in /bin and a lot of the dart tools hardcode a #!/bin/bash shebang that fails the 'all' target build (not able to execute dart2js since the interpreter is not found).

I would like to replace those paths with #!/usr/bin/env bash which should work on Linux, Mac OS X & all BSD's.

Places with a hardcoded shebang are as follows:

$ git grep /bin/bash
pkg/analysis_server/tool/spec/generate_files:#!/bin/bash
pkg/analyzer/tool/generate_files:#!/bin/bash
runtime/tools/bmu_benchmark_gallery.sh:#!/bin/bash
sdk/bin/dart:#!/bin/bash
sdk/bin/dart2js:#!/bin/bash
sdk/bin/dart2js_developer:#!/bin/bash
sdk/bin/dart2js_sdk:#!/bin/bash
sdk/bin/dartanalyzer:#!/bin/bash
sdk/bin/dartanalyzer_developer:#!/bin/bash
sdk/bin/dartanalyzer_sdk:#!/bin/bash
sdk/bin/dartdoc:#!/bin/bash
sdk/bin/dartfmt:#!/bin/bash
sdk/bin/dartfmt_sdk:#!/bin/bash
sdk/bin/pub:#!/bin/bash
sdk/bin/pub_sdk:#!/bin/bash
site/try/create_manifest.sh:#!/bin/bash
tests/standalone/io/create_sample_certificates.sh:#!/bin/bash
tests/standalone/io/dart_std_io_pipe_test.sh:#! /bin/bash
tools/apps/update_homebrew/bin/ssh_with_key:#!/bin/bash
tools/apps/update_homebrew/bin/update_homebrew.dart:      #!/bin/bash
tools/bots/run_android_tests.sh:#!/bin/bash
tools/create_debian_chroot.sh:#!/bin/bash
tools/dartium/download_shellscript_template.sh:#!/bin/bash
tools/dartium/start_dartium_roll.sh:#!/bin/bash -e
tools/dom/scripts/go.sh:#!/bin/bash -x
tools/precompilation/test_linux.sh:#!/bin/bash -ex
tools/precompilation/test_linux_simarm.sh:#!/bin/bash -ex
tools/precompilation/test_macos.sh:#!/bin/bash -ex
tools/presubmit.sh:#!/bin/bash
tools/testing/bin/jsshell:#!/bin/bash

Metadata

Metadata

Assignees

Labels

area-sdkUse area-sdk for general purpose SDK issues (packaging, distribution, …).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions