tldr-pages / tldr

📚 Collaborative cheatsheets for console commands
https://tldr.sh
Other
51.26k stars 4.22k forks source link

Revisiting all bash builtin commands #10584

Open Managor opened 1 year ago

Managor commented 1 year ago

As I suggested in https://github.com/tldr-pages/tldr/pull/10579 and https://github.com/tldr-pages/tldr/pull/10580, all bash builtin commands should be revisited. They can easily be listed with help or enable. To list all shell keywords compgen -k

First of all their linked manual pages link to some Tcl programming language manuals like for example https://manned.org/while instead of anything useful like https://www.gnu.org/software/bash/manual/bash.html#index-while Secondly some of these commands might be fully POSIX compliant, but Windows doesn't care about POSIX. Thus they should be moved from common to linux. Ideally they'd be moved to *nix, but we don't have that category. Thirdly it needs to be considered which commands are exclusive to Bash, which commands apply to other *nix as well and which commands are POSIX compliant but with additions and edit the description to match that.

Tick a checkbox after you've verified the things listed above in a command.

Builtins

Shell syntax

Resources: https://www.gnu.org/software/bash/manual/bash.html#Reserved-Words https://manned.org/man/while.1 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

Managor commented 1 year ago

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html This seems to be a manual for POSIX shell commands

Managor commented 1 month ago

enable is probably better for listing builtins

Managor commented 1 month ago

While looking through my old commits, I stumbled upon the list found in the manpage of while https://manned.org/man/while.1

EDIT: Note that the man page appears to be for csh. builtin is using this in its description and probably needs to be replaced. Many of the builtins listed do not apply to bash.

Managor commented 1 month ago

Lots of pages in pages/linux instead of pages/common. Also several duplicates that are found in both.

Managor commented 1 month ago

. = source [ = test % = fg % : = true (Only on surface level)