#!/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