pure-bash-bible icon indicating copy to clipboard operation
pure-bash-bible copied to clipboard

TODO

Open dylanaraps opened this issue 7 years ago • 8 comments

  • [x] Dynamic variable naming.
  • [x] Internal variables.
  • [x] Turn the non-functions into functions.
    • This is so tests can be written.
    • It also shows a working use case for the task.
  • [x] Add a CONTRIBUTING.md.
  • [ ] Look into side effects of using shopt and set.
  • [ ] /dev/tcp
  • [ ] Convert to pdf
    • [ ] Add a cover.
    • [ ] Add references.
  • [ ] Write some in-depth descriptions for all of the functions.
    • [ ] How they work.
    • [ ] What tools they replace.
    • [ ] Caveats
    • [ ] ???
  • [ ] Add argument parsing.

dylanaraps avatar Jun 14 '18 01:06 dylanaraps

if I may add to your to-do list, mathematical operations would be cool addition. EDIT 21/6/2018: I did a bit of a research, apparently bash's math is limited to what was already written in the bible :disappointed:, maybe I missed something?

Also sidenote, I love this bible :+1:

zutto avatar Jun 21 '18 06:06 zutto

Will do, cheers!

dylanaraps avatar Jun 21 '18 06:06 dylanaraps

There's all of the arithmetic operators: http://tldp.org/LDP/abs/html/ops.html (which is what I thought you meant).

dylanaraps avatar Jun 21 '18 07:06 dylanaraps

maybe set operations ? by the way :+1: really good job !

gilles13 avatar Jun 21 '18 07:06 gilles13

Does bash have set operations? Edit: I see what you mean now. I don't think this is possible in pure bash but I'll work on it.

dylanaraps avatar Jun 21 '18 08:06 dylanaraps

Might be nice to see some pure-bash / POSIX process-management examples (since bash is usually used as a scripting language to manage processes).

  1. How to start a process while grabbing and saving its PID.
  2. Wait for a process to finish and conditionally execute based on return code.
  3. Do something when a process returns something other than zero.
  4. Kill a process based on its PID and don't continue until it is dead.

EDIT: If one of the trap operations already covers this, some examples would be nice.

EDIT 2: This link may be a good resource if someone wants to add a few formatted examples here.

kalexmills avatar Aug 10 '18 16:08 kalexmills

Could you add a section discussing the usage of printf vs echo.

Is there a significant performance difference between the 2, or as the project is using BASH, and only BASH, is it just personal preference? Both are used in the README.md without mention of why there has been a switch.

php1ic avatar Aug 28 '18 10:08 php1ic

Hey

Might be nice to have exit code section with the meaning of those codes and how you can tweak them in order to concat more then one script based on prev exit code

I.E script 1 ended with exit code 0 , go to next script 2 OR print error

stickydrive avatar Oct 02 '19 22:10 stickydrive