Paste and run commands from bash, zsh, fish in xonsh shell.
Project description
Paste and run commands from bash, zsh, fish in xonsh shell.
If you like the idea click ⭐ on the repo and stay tuned.
Install
xpip install -U xontrib-sh
echo 'xontrib load sh' >> ~/.xonshrc
# Reload xonsh
Usage
Start a line with an exclamation point — !
— then paste the sh-compatible commands
after it and run. The command syntax will be tested in installed shells (bash, zsh, fish, sh)
and the commands will be run in the first matching shell.
The commands will be executed in the environment that will be inherited from current but if the commands modify the environment there will no changes in source xonsh environment.
Use cases
One line: brace expansion (bash syntax)
! echo 01.{05..10}
bash:
01.05 01.06 01.07 01.08 01.09 01.10
Many lines: for loop (zsh syntax)
! for x (1 2 3); do
echo $x;
done
for x (4 5 6); do
echo $x;
done
zsh:
1
2
3
4
5
6
Set certain shell for all commands
$XONTRIB_SH_SHELLS = ['zsh']
Credits
This package was created with xontrib cookiecutter template.
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
Hashes for xontrib_sh-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c420c3c785b34d59e57428d311d5c82ba08c703c55ed36d37519347ce0f1f1 |
|
MD5 | e44ec22874f4635f059f0d4f44dcea60 |
|
BLAKE2b-256 | 217ab78766734007aa0aedbdb4fc34767d649fd6c4866a752dad261abf2af5fc |