Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,010,511 members, 7,358,082 topics. Date: Wednesday, 22 March 2023 at 05:10 AM
Nairaland Forum / Science/Technology / Programming / Building My TODO Terminal App Using Bash (310 Views)
|Building My TODO Terminal App Using Bash by Deicide: 10:25pm On May 16, 2022|
Wanted to use python to build this just for fun but then I realised that using bash would be more flexible So Nlanders, join me on this journey any suggestions or ideas are welcomed.
Am using termux terminal on Android to build this.
|Re: Building My TODO Terminal App Using Bash by Deicide: 10:34pm On May 16, 2022|
First thing first. Where to store what to do? Since this is a simple Todo app we wouldn't be storing it in any kind of relational database like MySQL or sqllite etc. We'll be using simple ".txt" file. though I might change to ".Json" format later? I think that would be more flexible.
For now this is the code I have.
|Re: Building My TODO Terminal App Using Bash by Deicide: 11:09am On May 20, 2022|
After lots of thinking and well for flexibility, I decided to go with Json text format that way I can access data easily.
I also have to define data that would be needed for the Todo list. Honestly I don forget watin Todo list suppose to day do o
|Re: Building My TODO Terminal App Using Bash by Deicide: 11:19am On May 20, 2022|
Now the logic for storing the task in Json. I did my research and discovered that I can use a tool called "Jo" to process data to JSON format. So....
pkg install jo
The logic for storing the data in the Json file is in the picture below.
|Re: Building My TODO Terminal App Using Bash by Deicide: 11:23am On May 20, 2022|
We could test this logic by adding some data Todo in the Json file.
./todo add "Go to the supermarket"
./todo add "Take friend out to the mall"
The processed output look something like this.
Linking Up With Other C++ Developers / Brighten Your Programming Skill And Also Make Money Online Through A Proven Plat / How To Rank Your Products Up In Etsy Search Results?
|Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health |
religion celebs tv-movies music-radio literature webmasters programming techmarket
Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Nairaland - Copyright © 2005 - 2023 Oluwaseun Osewa. All rights reserved. See How To Advertise. 30