Created
May 31, 2022 07:50
-
-
Save lynsei/7846cbc5855f44c5be81c34d53acc2f0 to your computer and use it in GitHub Desktop.
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
| # lyns lang [superset of fish] | |
| # | |
| # replace the output of npm pkg get as commands and generate an array from them: | |
| set -e n && npm pkg get cmds | \ | |
| head -n-1 | \ | |
| tail -n +2 | \ | |
| while read -at i; \ | |
| set n "$n""$i"\n; \ | |
| end && \ | |
| echo -n $n | \ | |
| string replace ',' '' | |
| # or simply: | |
| set -e n && npm pkg get cmds | head -n-1 | tail -n +2 | while read -at i; set n "$n""$i"\n; end && echo -n $n | string replace ',' '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment