Last active
May 16, 2020 00:30
-
-
Save danielbayley/751d2603057851990de93fb3a0a001ea to your computer and use it in GitHub Desktop.
Make any command accept stdin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/zsh --no-rcs --err-exit | |
| pushd = cd () { builtin $0 "${@:-`<&0`}"} | |
| pwd # $HOME | |
| print ~/Desktop | cd | |
| pwd # ~/Desktop | |
| cd - | |
| pwd # $HOME | |
| pwd # $HOME | |
| print ~/Desktop | pushd | |
| pwd # ~/Desktop | |
| popd | |
| pwd # $HOME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment