generated from tyler/Generic-Template
Add back base commands
This commit is contained in:
parent
5b654a5ff0
commit
6e8592b785
17
src/tpeek
Executable file
17
src/tpeek
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
#zero arguments
|
||||
if [ "$#" -ne 0 ]; then
|
||||
echo "Usage:" $0
|
||||
echo "Returns what is at the top of the todo stack"
|
||||
fi
|
||||
|
||||
if [ -z "${TODO_LOCATION}" ]; then
|
||||
mkdir -p $HOME/.config/stackToDo
|
||||
TODO_LOCATION="$HOME/.config/stackToDo/todo"
|
||||
fi
|
||||
|
||||
#make correct directories
|
||||
touch $TODO_LOCATION
|
||||
|
||||
tail -1 $TODO_LOCATION
|
16
src/tpop
Executable file
16
src/tpop
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
#must have no arguments
|
||||
if [ "$#" -ne 0 ]; then
|
||||
echo "Usage:" $0
|
||||
echo "Remove the last element of the stack and prints it"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${TODO_LOCATION}" ]; then
|
||||
TODO_LOCATION="$HOME/.config/stackToDo/todo"
|
||||
mkdir -p $HOME/.config/stackToDo
|
||||
fi
|
||||
|
||||
tail -1 $TODO_LOCATION
|
||||
sed -i '$ d' $TODO_LOCATION
|
22
src/tpush
Executable file
22
src/tpush
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
#must have an argument
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Usage:" $0 "[STRING TO PUT ON STACK]"
|
||||
echo "Pushes the given string to the top of the todo stack"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
str="'$*'"
|
||||
|
||||
if [ -z "$str" ]; then
|
||||
echo "Must provide a non empty argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${TODO_LOCATION}" ]; then
|
||||
mkdir -p $HOME/.config/stackToDo
|
||||
TODO_LOCATION="$HOME/.config/stackToDo/todo"
|
||||
fi
|
||||
|
||||
echo $str >> $TODO_LOCATION
|
Loading…
Reference in New Issue
Block a user