Reply
Thread Tools
Posts: 100 | Thanked: 307 times | Joined on Jan 2015 @ Argentina
#1
Well it's not a big deal. I was playing with termux and its capabilities so i wrote this simple script.
What it does?
- add a note with the actual time to a file of the actual day.
- Show the entries you made on the actual day

It creates a folder on $HOME/7102kdat and stores your data
Uses a file in the format kYYYYMMDD.dat. 1 file for day with notes.

It should work on n900, n9, and busybox, perhaps with any/no modification

Code:
#!/bin/bash
# keacx.sh simple diary entry for termux
# by maegon9y00 
# 28nov 2017
# Commands used: date, if then echo read clear less exit
# variables used: $ARC $CAR $# $KEHAGO $HOR   
# Usage: . keacx.sh your_anotations
# Usage: . keacz.sh [Enter]

ARC=k$(date +%Y%m%d).dat #nombre del archivo de datos 
CAR=$HOME/7102kdat #path de datos

if [[ ! -d $CAR ]]; then mkdir $CAR; fi #make folder 1st time
if [ $# -eq 0 ]   # $# te dice cuantos argumentos pasaron al script, si son 0 entonces te pregunta
  then
	echo -e '\033[32m Que haces? \033[0m' # pregunta en color verde(32) y luego al blanco habitual (0)
	read -e KEHAGO
	HOR=$(date +%H:%M:%S)
	echo $HOR $KEHAGO
	clear
	echo $HOR $KEHAGO>>$CAR/$ARC
	echo -e '\033[34m'  # cambia a color azul
	less $CAR/$ARC
	exit 1 # da por terminada la condición y finaliza el script si se cumple la condición
 fi


# Si me escribió un argumento, lo agrega sin preguntarme.
HOR=$(date +%H:%M:%S)
	echo $HOR $*
	clear
	echo $HOR $*>>$CAR/$ARC
	echo -e '\033[33m'  # cambia a color amarillo
	less $CAR/$ARC

Last edited by maegon9y00; 2017-11-28 at 17:28.
 

The Following User Says Thank You to maegon9y00 For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#2
Sorry, I do not have anything useful to contribute, all I have to say is,

"Dairy"? Blessed are the cheese makers?
__________________
Русский военный корабль, иди нахуй!
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
Posts: 100 | Thanked: 307 times | Joined on Jan 2015 @ Argentina
#3
Originally Posted by pichlo View Post
Sorry, I do not have anything useful to contribute, all I have to say is,

"Dairy"? Blessed are the cheese makers?
Thanks pichlo for let me know this mistake.
I corrected the "dairy" thing.
 

The Following 2 Users Say Thank You to maegon9y00 For This Useful Post:
Reply

Tags
script, termux

Thread Tools

 
Forum Jump


All times are GMT. The time now is 01:22.