Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 3.09 KB

README.md

File metadata and controls

76 lines (57 loc) · 3.09 KB

crudsh

Build Status

CRUD to learn basic and widely used bash(GNU Bourne Again SHell) shell scripts snippets. Data stored in plain text file (see users.txt).

Prerequisite

  • Knowledge
    • Not any knowledge of any programming language required but good to have. It's a easy to learn resource for bash beginners.
  • Tools
    • CLI access to any *nix based OS
  • No dependencies are required but there is one optional development dependency for unit testing - shUnit2 and can be installed in Ubuntu by sudo apt-get install shunit2
  • Optional dependency: tldr-pages/tldr will help you to learn commands more faster and easily

Installation and setup

  1. $ git clone https://github.com/SOHELAHMED7/crudsh.git
  2. $ cd crudsh
  3. $ chmod +x index.sh
  4. $ ./index.sh

Undo installation

  • just delete crudsh folder
  • in case shunit2 is installed, hit $ sudo apt-get purge shunit2

Features

  • Validation (kept simple to focus on learning bash)
  • Add, Update, Delete
  • Listing with pagination, searching and sorting
  • Documented

Order of file/feature to review

  1. index.sh
  2. show_menu.sh
  3. take_menu_input_from_user.sh
  4. add feature (add.sh with validation and required files within)
  5. delete feature
  6. edit feature (validation, common.sh, sql_queries.sh)
  7. list_all.sh
  8. list_with_pagination.sh (seach, sort, pagination, per per user )

Notes

  • developed in bash version 4.4.19(1) and Ubuntu
  • it is very unlikely that this app can be directly fit your app's use case but can be used to learn your own CLI app
  • this is made for education and exercise purpose for bash beginners
  • a CLI app can also be developed by your favorite programming/ framework like Yii, Laravel etc without any knowledge of bash
  • Bash is very ancient! Why should I learn see kamranahmedse/developer-roadmap and Master Foo and the Ten Thousand Lines

Testing

  1. $ cd test
  2. $ shunit2 main.sh

Credits and Thanks

Similar Project/Alternatives

Licence

GNU Affero General Public License v3.0

Is it any good?

Yes