I wrote a "Todo" bash scripting program which have menu of options for adding a new task, remove finished task from pending file and add it to done file ,etc.
it supposed to make pending_file.txt
and done_file.txt
after running options, but it only creates .txt
which is regarding to pending_file.txt
and done_file.txt
isnt created
it runs properly and I expect it to make pending_file.txt
and done_file.txt
, but it didn't create them
move_to_done(){
read -p "Enter finished task description: " finished_task
if [ ! -f "$pending_file.txt" ]; then
echo "No pending tasks"
return
else
sed -i "s/$finished_task//g" $pending_file.txt
if [ ! -f "$done_file.txt" ]; then
touch $done_file.txt
echo "$finished_task" >> $done_file.txt
echo "Task marked as done"
fi
fi
}
show_finished_tasks(){
if [ ! -f "$done_file.txt" ]; then
echo "No finished tasks"
else
cat $done_file.txt
fi
}