Skip to main content

From sheBanG to Shim

Project description

BanG Shim!

Make scripts with shebang executable in Windows by adding shim.

Usage

  1. Install bangshim with uv
uv tool install --from git+https://github.com/Winterreisender/bangshim bangshim

or pip

pip install git+https://github.com/Winterreisender/bangshim

We'll publish bangshim to PyPI soon.
It's also recommended to install uutils/coreutils for the env in shebang

  1. Write any script with shebang, supposing you have an intepreter (Git Bash, MSYS2, etc.) installed for your scripts.
#!/usr/bin/sh
print("Hello World")
  1. Make your script executable
bangshim ./myscript.sh
./myscript
# "Hello World"

FAQ

  1. Q: Why doing this?
    A: shebang is the Unix way for executable scripts, while shim are the best practice for Windows. And this is a tool to make the Unix style work in Windows.

  2. Q: How it works?
    A: bangshim do a simple things, search intepreter from shebang in PATH, and generate args for shim.

  3. Q: How to work with /usr/bin/env ?
    A: We suppose you installed an env.exe in your PATH. For example, you can install uutils/coreutils by scoop install uutils-coreutils

Build

See Makefile for more information

Credit

  1. shim.exe from kiennq/scoop-better-shimexe licensed under MIT OR Unlicense

License

Copyright 2025 Winterreisender

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bangshim-0.0.2.dev5.tar.gz (87.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bangshim-0.0.2.dev5-py3-none-any.whl (86.6 kB view details)

Uploaded Python 3

File details

Details for the file bangshim-0.0.2.dev5.tar.gz.

File metadata

  • Download URL: bangshim-0.0.2.dev5.tar.gz
  • Upload date:
  • Size: 87.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.15

File hashes

Hashes for bangshim-0.0.2.dev5.tar.gz
Algorithm Hash digest
SHA256 66c4e5d2c13625a76e5af0d1d35b787fdce4284138424fa77d9bf47476aac2b1
MD5 0917f00e8f06204e487548f80388b484
BLAKE2b-256 347d34f08985727dd0e39531035e3dc10a129927715f1be78dc1cb7358acb5d3

See more details on using hashes here.

File details

Details for the file bangshim-0.0.2.dev5-py3-none-any.whl.

File metadata

File hashes

Hashes for bangshim-0.0.2.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 b027bc19cc1623af91fce2afd2f49ca4ce412eee8761aa5f3cbe55cc7355ad86
MD5 2267a642629c1d55172b651da689478d
BLAKE2b-256 14bf9267620f8f0a1e94b0d76daebab6ffd7beb57794ff6e4a1a42525e28df95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page