Différences entre versions de « Journal.sh »

De ɴon-ᴀ
Sauter à la navigation Sauter à la recherche
m
m
Ligne 8 : Ligne 8 :
 
# save the text (with the date) on a text file
 
# save the text (with the date) on a text file
 
# send it to my server ?
 
# send it to my server ?
 +
 +
== bash script ==
 +
<nowiki>#!/bin/bash
 +
 +
now=$(date)
 +
entry=""
 +
 +
echo "$now"
 +
echo " "
 +
echo "👋 hello martin, how are you feeling today ?"
 +
echo " "
 +
read -r input
 +
echo "you wrote :"
 +
entry="$now  $input"
 +
echo "$entry"
 +
echo " " >> ~/w0rk/journal.sh/log.txt
 +
echo "$entry" >> ~/w0rk/journal.sh/log.txt
 +
</nowiki>

Version du 17 mai 2021 à 11:39


A simple bash script to force me to journal everytime I switch on my trusty laptop.

process:

  1. at startup
  2. prompt to write in the console
  3. save the text (with the date) on a text file
  4. send it to my server ?

bash script

#!/bin/bash

now=$(date)
entry=""

echo "$now"
echo " "
echo "👋 hello martin, how are you feeling today ?"
echo " "
read -r input
echo "you wrote :"
entry="$now  $input"
echo "$entry"
echo " " >> ~/w0rk/journal.sh/log.txt
echo "$entry" >> ~/w0rk/journal.sh/log.txt