Skip to main content

shed - the sh editor

Don’t run curl | sh again. Use curl | shed to verify scripts before running.

Usage

Replace sh with shed in any pipe-sh commands you run. shed will:

  • save the piped script to a temp file

  • open the temp file in $SHED_EDITOR or $EDITOR to let you view and modify the script

  • ask you if you still want to run the script, preserving any changes you made

Installation

This is a Python 3 script, so use pip3 to install:

pip3 install shed_sh

Note the spelling: shed_sh is different from shed.

After this, run shed or bashed from your terminal to verify it’s installed properly.

Examples

Piping to sh

Take your questionable curl-pipe-sh or wget-pipe-sh command

curl -L https://npmjs.org/install.sh | sh
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

and use shed to view and edit your script before running it:

curl -L https://npmjs.org/install.sh | shed
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | shed

Piping to bash

bashed protects your bash shell, too: take this unknown script

wget -q -O - https://fixubuntu.com/fixubuntu.sh | bash

and verify the contents before running:

wget -q -O - https://fixubuntu.com/fixubuntu.sh | bashed

Config

Set your preferred editor:

export SHED_EDITOR=vim

shed also checks $EDITOR, then falls back to nano, vim, vi, and emacs in order.

Contributions

Bug reports, fixes, or features? Feel free to open an issue or pull request any time. You can also tweet me at [@mplewis](http://twitter.com/mplewis) or email me at matt@mplewis.com.

License

Copyright (c) 2014 Matthew Lewis. Licensed under the MIT License.

Release files for shed_sh 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shed_sh 1.0.0
File Size Uploaded
shed_sh-1.0.0.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shed_sh 1.0.0
File Interpreter ABI Platform
shed_sh-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / shed_sh-1.0.0.tar.gz

Download URL shed_sh-1.0.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
74ab9c5de29d0393c02f806201005c06d762a1a21dfa0111f748fd447d5c954f
BLAKE2b-256 checksum
How to use checksums
513dda620089f2db44f426a85225c134cbfe244ce36eb007c56addea08b7d064
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / shed_sh-1.0.0-py3-none-any.whl

Download URL shed_sh-1.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f062a43831f9746f8a247ed7eeb8dc7000d85a7f65827d436edea703a0feb642
BLAKE2b-256 checksum
How to use checksums
46bb9ad0dc44f8d370faf4c368ae1333c2a4b6eb98249d4adc48646a03757c0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page