Creating a file for writing, with Bash
Intro
I want to write down some thoughts. For this I create a file named
yyyy-mm-dd.txt
and open it in Vim.
But I want a command to do it for me. Let's call this command
wr
.
The script
With the help of ChatGPT I got the following script.
Running it from the terminal
-
Save the script at
~/bin/wr
whenwr
is the file -
Change the file permissions with
chmod 700 ~/bin/wr
-
Add the
~/bin
dir to PATH by addingexport PATH="$HOME/bin:$PATH"
to~/.zshrc