Don't run "curl | sh" again. Use "curl | shed" to verify scripts before running.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file shed_sh-1.0.0.tar.gz
.
File metadata
- Download URL: shed_sh-1.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ab9c5de29d0393c02f806201005c06d762a1a21dfa0111f748fd447d5c954f |
|
MD5 | 71c6aed8d9b92f4ea78d07d8e78ec33d |
|
BLAKE2b-256 | 513dda620089f2db44f426a85225c134cbfe244ce36eb007c56addea08b7d064 |
File details
Details for the file shed_sh-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: shed_sh-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f062a43831f9746f8a247ed7eeb8dc7000d85a7f65827d436edea703a0feb642 |
|
MD5 | 4b8b5801da16089cd2c73345aadafe09 |
|
BLAKE2b-256 | 46bb9ad0dc44f8d370faf4c368ae1333c2a4b6eb98249d4adc48646a03757c0c |