[HN Gopher] Ask HN: Share a shell script you like
___________________________________________________________________
Ask HN: Share a shell script you like
Hi, I'd like to ask what are the shell scripts you enjoy using or
find useful? It might be something you incorporated to your
terminal-based workflow. Or maybe some specific scripts that you
often reuse. Or you have used it once, but it might be useful to
other people. Or maybe you just have a script that is fun to use?
Please share My (not anymore) hidden intention is to gather your
recommendations to build an open-source shell script registry
https://spellbook.maczan.pl/ Source code is here for you if you
want to self host or fork it https://github.com/jmaczan/spellbook
A script I sometimes use is a commands repeater
https://registry.spellbook.maczan.pl/repeat-sh/spell.sh You can
specify an interval and a flag to reset/keep the terminal's content
after a script invocation Thanks!
Author : yu3zhou4
Score : 13 points
Date : 2023-08-13 18:57 UTC (4 hours ago)
| frfl wrote:
| - quickly jump to recent directory: https://github.com/rupa/z -
| however I find it kinda annoying it seems to forget/ignore(?)
| directories, anyone know of a better version of this?
|
| - quickly opening my personal wiki:
| https://github.com/francium/dotfiles/blob/master/bin/.local/...
|
| - re-run a script when a file changes:
| https://github.com/francium/dotfiles/blob/master/bin/.local/...
|
| For `while-watchdo` you, you run it like `while-watchdo "echo
| hi"`, then in my editor, I have a custom shortcut that does
| `touch .watchfile` causing the command, in this case `echo hi` to
| run. I prefer this to tools that retrigger commands as soon as
| you save _any_ file. Also works in docker containers, edit a file
| on host, command runs in a container.
| LanternLight83 wrote:
| Re: Z, there's Atuin: https://github.com/atuinsh/atuin
| comprev wrote:
| shellcheck, whilst not a script itself, I do find it useful when
| writing them.
|
| - https://github.com/koalaman/shellcheck
| pydave wrote:
| diffconflicts [dc] lets you resolve diffs as a two way diff
| between what's in the conflict markers instead of including the
| resolved parts in the diff. It opens the diff in vim but could be
| adapted for other editors. Verbose explanation:
| https://github.com/whiteinge/diffconflicts/blob/master/READM...
|
| The author converted it to a vim plugin with the same name, but I
| use a different vim plugin implementation [mergetool].
|
| [dc]:
| https://github.com/whiteinge/dotfiles/blob/master/bin/diffco...
| [mergetool]: https://github.com/idbrii/vim-mergetool
| stop50 wrote:
| The most common things i use in the different shells are loops
| and a few things from different git repos i load with zplug
___________________________________________________________________
(page generated 2023-08-13 23:02 UTC)