# Shell script to speed up note-taking in terminal

**URL:** <https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229>\
**Category:** Apps\
**Created:** [10 June 2018 00:50 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229 "2018-06-10T00:50:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pynting](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/pynting/32/540_2.png) [@pynting](https://discourse.joplinapp.org/u/pynting)\
**Post date:** [10 June 2018 00:50 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229/1 "2018-06-10T00:50:52Z")

</div>

Hello All,  
Inspired by the speed and ease of entering tasks using Taskwarrior or todo.txt, I wrote this script to help make Joplin better if you only need to write a quick note. It is not a complete wrapper for joplin cli, it is only (so far) able to add notes with tags, sync and create notebooks (if needed).

You can use the -f option to enter silent mode, so that it does not return anything, I imagine it could be a helpful if you want to send notes to joplin from another program.

It can be found [HERE](https://github.com/pynting/joplin-note)

Hope somebody finds it helpful.

NB: Being my first shell script, it is probably plenty inefficient in terms of coding style, but it seems to get the job done as long as you stay inside of its limits!

---

<div class="post-metadata">

**Author:** ![stucki](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/stucki/32/137_2.png) [@stucki](https://discourse.joplinapp.org/u/stucki)\
**Post date:** [15 July 2018 20:28 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229/2 "2018-07-15T20:28:56Z")

</div>

Hi!

For a first script this is very well done!

But just because you mentioned ‘inefficient’,  
I remembered that `if [... 0 ...]` uses the program  
`test` (like bourne shell `sh` does), while you correctly  
use `bash` to have `$(...)` and arrays. In `bash` you  
have the internal `if [[... == ...]]` which does not use  
the external command.

Yours Stucki

---

<div class="post-metadata">

**Author:** ![pynting](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/pynting/32/540_2.png) [@pynting](https://discourse.joplinapp.org/u/pynting)\
**Post date:** [22 August 2018 22:33 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229/3 "2018-08-22T22:33:22Z")

</div>

This is a late reply, but I finally thought I might make changes to the script to use the builtin command instead, but in my research, it seems like both actually is builtin to most shells these days, but the “test” and “[” commands needs to be compatible with the old externals for compatibility. I have changed it in my script as it looks like the new “[[” is more robust, besides it gave me a reason to try and commit changes to the github repository!

I also added an export database switch to the code, as I am still not trusting Joplin to not delete all my notes again (although it seems better now that I got Nextcloud sync working instead of local sync.)  
Now one can easily use a different joplin profile, by uncommenting and commenting at the top of the script to use the desktop profile for instance. If used, it also checks to see if the desktop app is running before submitting the new note to prevent corrupting the database.

Another thing I was thinking of in regards to the script: should the tags people enter with the “+”-prefix be left in the note instead of removing them from the text as it currently does? The idea was that one could add them anywhere in the command, but if one uses them as words in the note body it might make sense to keep them in the text? Not sure how to implement this… remove tags entered before the title, but keep the ones entered after as part of the note body? I am currently not a big user of tags, so I am just trying to imagine use cases…

---

<div class="post-metadata">

**Author:** ![bepolymathe](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/bepolymathe/32/8492_2.png) [@bepolymathe](https://discourse.joplinapp.org/u/bepolymathe)\
**Post date:** [15 September 2021 09:34 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229/4 "2021-09-15T09:34:37Z")

</div>

@pynting Did you use this script for taskwarrior now ?

---

<div class="post-metadata">

**Author:** ![pynting](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/pynting/32/540_2.png) [@pynting](https://discourse.joplinapp.org/u/pynting)\
**Post date:** [15 September 2021 10:07 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229/5 "2021-09-15T10:07:30Z")

</div>

I am not sure exactly what you mean?  
It is a script that interfaces with joplin-cli, not taskwarrior...  
I have not used the script in a long time, and it should be considered no longer maintained.

---

<div class="post-metadata">

**Author:** ![bepolymathe](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/bepolymathe/32/8492_2.png) [@bepolymathe](https://discourse.joplinapp.org/u/bepolymathe)\
**Post date:** [15 September 2021 10:32 UTC](https://discourse.joplinapp.org/t/shell-script-to-speed-up-note-taking-in-terminal/229/6 "2021-09-15T10:32:11Z")

</div>

Okay thanks, that answers my question.
