Make an executable script called $ your PATH [link]

There’s so many code examples that hint at running your code on the terminal prompt, and that hint is a $ character at the start.
I’ve written about how I run my blog in a way that this character isn’t actually part of the content (it’s an non-selectable CSS pseudo element), but this doesn’t help when taking code from other sites.
Mikkel’s tiny, tiny script is so elegant I pinched it right away. The script, called $ consists entirely of:
#!/bin/zsh
$@

Now whenever I paste a line starting with $ … the command runs as I would intend. Perfect!
Source: github.com


This content originally appeared on remy sharp's b:log and was authored by remy sharp's b:log

There's so many code examples that hint at running your code on the terminal prompt, and that hint is a $ character at the start.

I've written about how I run my blog in a way that this character isn't actually part of the content (it's an non-selectable CSS pseudo element), but this doesn't help when taking code from other sites.

Mikkel's tiny, tiny script is so elegant I pinched it right away. The script, called $ consists entirely of:

#!/bin/zsh
$@

Now whenever I paste a line starting with $ ... the command runs as I would intend. Perfect!

Source: github.com

Originally published on Remy Sharp's b:log


This content originally appeared on remy sharp's b:log and was authored by remy sharp's b:log


Print Share Comment Cite Upload Translate Updates
APA

remy sharp's b:log | Sciencx (2020-11-17T04:58:02+00:00) Make an executable script called $ your PATH [link]. Retrieved from https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/

MLA
" » Make an executable script called $ your PATH [link]." remy sharp's b:log | Sciencx - Tuesday November 17, 2020, https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/
HARVARD
remy sharp's b:log | Sciencx Tuesday November 17, 2020 » Make an executable script called $ your PATH [link]., viewed ,<https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/>
VANCOUVER
remy sharp's b:log | Sciencx - » Make an executable script called $ your PATH [link]. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/
CHICAGO
" » Make an executable script called $ your PATH [link]." remy sharp's b:log | Sciencx - Accessed . https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/
IEEE
" » Make an executable script called $ your PATH [link]." remy sharp's b:log | Sciencx [Online]. Available: https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/. [Accessed: ]
rf:citation
» Make an executable script called $ your PATH [link] | remy sharp's b:log | Sciencx | https://www.scien.cx/2020/11/17/make-an-executable-script-called-your-path-link/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.