54 lines
830 B
Bash
Executable File
54 lines
830 B
Bash
Executable File
#!/bin/bash
|
|
#set editor of choice
|
|
ed=vim
|
|
|
|
#list options
|
|
clear
|
|
echo "What would you like to do?"
|
|
echo "1: list notepads"
|
|
echo "2: make notepad"
|
|
echo "3: edit notepad"
|
|
echo "4: remove notepad"
|
|
read -p "ctrl + c to exit: " sel
|
|
|
|
|
|
#seting options
|
|
if [[ $sel = 1 ]];
|
|
then
|
|
clear
|
|
ls .notes_data
|
|
read
|
|
./notes.sh
|
|
elif [[ $sel = 2 ]];
|
|
then
|
|
clear
|
|
ls .notes_data
|
|
echo""
|
|
echo "What would you like to call it?"
|
|
read -p "ctrl + c to exit: " name
|
|
touch .notes_data/$name
|
|
read -p "Done"
|
|
./notes.sh
|
|
elif [[ $sel = 3 ]];
|
|
then
|
|
clear
|
|
ls .notes_data
|
|
echo "What would you like to edit?"
|
|
read -p "ctrl + c to exit: " edit
|
|
$ed .notes_data/$edit
|
|
./notes.sh
|
|
elif [[ $sel = 4 ]];
|
|
then
|
|
clear
|
|
ls .notes_data
|
|
echo "What would you like to remove?"
|
|
read -p "ctrl + c to exit: " remove
|
|
rm .notes_data/$remove
|
|
./notes.sh
|
|
else
|
|
clear
|
|
echo "Invalid"
|
|
read
|
|
./notes.sh
|
|
fi
|