-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgb.organize
executable file
·45 lines (37 loc) · 939 Bytes
/
gb.organize
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
. gb._gohome
fname=random
cp $fname backups/$fname`date +%s`
cp $fname backups/last
cp $fname temp_base
echo "
" >> temp_base
while csplit --quiet -f temp temp_base /^$/+1
do
cp temp01 temp_base
if [ -z "`cat temp00`" ]; then
echo ".................EMPTY NOTE FOUND.................."
else
echo ".................READING NOTE................."
cat temp00
uniqueID=`date +%s`
#Create a separate file which is named by the second it was created
#Note:: This means you cannot create multiple notes per second
cp temp00 $uniqueID
#When the thing was created is important
echo filed:$uniqueID >> .$uniqueID
cat .gen >> .$uniqueID
echo "PLEASE ADD TAGS TO THIS NOTE"
echo "(empty line means you're done)"
#Add tags to meta-file one by one.
read tagin
while ! [ "$tagin" = "" ]
do
echo $tagin >> .$uniqueID
read tagin
done
fi
done
#Just a little cleanup
rm $fname
rm temp00 temp01
rm temp_base