CRUD to learn basic and widely used bash(GNU Bourne Again SHell) shell scripts snippets. Data stored in plain text file (see users.txt).
- 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
$ git clone https://github.com/SOHELAHMED7/crudsh.git
$ cd crudsh
$ chmod +x index.sh
$ ./index.sh
- just delete
crudsh
folder - in case shunit2 is installed, hit
$ sudo apt-get purge shunit2
- Validation (kept simple to focus on learning bash)
- Add, Update, Delete
- Listing with pagination, searching and sorting
- Documented
- index.sh
- show_menu.sh
- take_menu_input_from_user.sh
- add feature (add.sh with validation and required files within)
- delete feature
- edit feature (validation, common.sh, sql_queries.sh)
- list_all.sh
- list_with_pagination.sh (seach, sort, pagination, per per user )
- 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
$ cd test
$ shunit2 main.sh
- This app is created as exercise provided at shellscript.sh by Steve Parker
- Quick answer given at StackOverflow by mureinik
- All links provided in code
- users.txt is seeded from https://mockaroo.com/
- gif - https://ezgif.com
- Pure bash Bible
- https://www.shellscript.sh/exercises.html
- https://github.com/wlinnp/CRUD-operations-on-text-file
- andrewbihl/bsed