GNU/Linux ◆ xterm-256color ◆ bash 528 views

printf-time

C syntax which calculates Easter day and Paschal Full Moon. (gcc)

github : branch v0.1.1 added a ‘print to file’ feature, GDB notes Dir, and a a help/error feature.

Description:

A C program which uses C syntax and the GCC compiler to calculate the date of the Paschal Full Moon (PMF) and the date of Easter Day.

This app is a C refresher as well as an exercise in using the CLI to debug in GDB. I deliberately omitted the string.h library to force myself to manually perform C string manipulations.

The program is in the C_Source folder.

Feature algorithms:

  • Gauss Easter Algorithm
  • Anonymous Easter Algorithm
  • Meeus Easter Algorithm
  • Paschal Full Moon (PFM) – primary output

Practical Bash Usecase

## Bash UI

bashVar=$(./main) 			## Store printf output to bash var
lastLine=$(echo "$bashVar" | tail -n1) 	## parse only the last output line
date --date=$lastLine 			## use printf string to generate a Bash date

## Bash generated output

Thu Apr 18 00:00:00 EDT 2019