Bash-Oneliner
ShellCheck
Our great sponsors
Bash-Oneliner | ShellCheck | |
---|---|---|
18 | 476 | |
7,857 | 33,053 | |
- | - | |
0.0 | 0.0 | |
about 2 months ago | 20 days ago | |
Haskell | ||
MIT License | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Bash-Oneliner
-
GitHub - onceupon/Bash-Oneliner: A collection of handy Bash One-Liners and terminal tricks for data processing and Linux system maintenance.
You forgot/accidentally dropped the actual link to your collection.
-
I Deleted 7TB of Videos Before Going to Production
Ctrl + x + Ctrl + e : launch editor defined by $EDITOR to input your command. Useful for multi-line commands.
I have tested this on windows with a MINGW64 bash, it works similarly to how `git commit` works; by creating a new temporary file and detecting* when you close the editor.
[0] https://github.com/onceupon/Bash-Oneliner
* Actually I have no idea how this works; does bash wait for the child process to stop? does it do some posix filesystem magic to detect when the file is "free"? I can't really see other ways
-
Bash-Oneliner: A collection of handy Bash One-Liners and terminal tricks
In case there is no space at all, sort will complain if the /tmp directory is on the same fs, then the only option is to search any suspect directories with du -sm $dir
And about this one: https://github.com/onceupon/Bash-Oneliner#using-ctrl-keys
A bit surprised that the Ctrl+b(ack one...) and Ctrl+f(orward one char) shortcuts are not included.
As well as their Alt+b/f for a word back/forward too. Very convenient for going through a long command by getting in the beginning or the end of the line, then move words back/forth to update it.
ShellCheck
-
Ask HN: How does one practice day to day shell scripting
I forgot to mention "shellcheck" at https://www.shellcheck.net/ and the explanation of its error codes at https://www.shellcheck.net/wiki/
This is also referenced by Shotts, and has been discussed on Hacker News -- not to be missed.
-
Ask HN: Share a shell script you like
shellcheck, whilst not a script itself, I do find it useful when writing them.
- Oils 0.17.0 – YSH Is Becoming Real
-
Pure Bash Bible
First, shellcheck:
I systematically run this on my scripts before using them.
Then shfmt for nice, reliable autoformatting:
-
Show HN: People forget that you can stick any data at the end of a bash script
Directives apply line by line. The online that applies to the whole file is mandated to be the next line right after shebang.
https://github.com/koalaman/shellcheck/wiki/Directive
> Directives that replace or are immediately after the shebang apply to the entire script. Otherwise, they are scoped to the command that follows it
https://github.com/koalaman/shellcheck/wiki/Ignore
> Note that the directive must be on the first line after the shebang with versions before 0.4.6. As of 0.4.6 comments and whitespace are allowed before file-wide directives.
There's an issue already about it: https://github.com/koalaman/shellcheck/issues/760
-
I'd like some feedback and suggestions for how to improve my shell script
ShellCheck: https://www.shellcheck.net/
-
Resources on learning bash scripting
Not a resource as you asked but may be useful when you start scripting to gives you best practices and things to avoid : https://www.shellcheck.net
no you can’t integrate within vim but you if you want to work straight on the terminal without using external IDE or text editors, I suggest you to install shellcheck from GitHub repo (https://github.com/koalaman/shellcheck) and run the command directly:
-
I want to start making my console apps, I only have experience with game dev, where should I start?
Whatever you use, make sure you have syntax highlighting, completion and error checking! I'm using pylsp and shellcheck in emacs, but those or similar options should work in any IDE, replacing much of what made IDEs unique in former times.
What are some alternatives?
bash-language-server - A language server for Bash
shfmt - Dockernized shfmt. This formats shell script.
shellharden - The corrective bash syntax highlighter
PowerShell - PowerShell for every system!
efm-langserver - General purpose Language Server
neomake - Asynchronous linting and make framework for Neovim/Vim
shfmt - A shell formatter (sh/bash/mksh)
sh - A shell parser, formatter, and interpreter with bash support; includes shfmt
stan - 🕵️ Haskell STatic ANalyser
hdocs - Haskell docs tool
proot - An chroot-like implementation using ptrace.
maam - A monadic approach to static analysis following the methodology of AAM