tth

@tth@pleroma.interhacker.space
47 Followers
118 Following
438 Posts
#Raytracing with #POVray : working on a new sequence for the #hexacone family

A habit I'm thinking of adopting for my shell scripting:

Write scripts in the form of a sequence of function definitions, with no commands at the top level that actually do anything. Then, at the very end, write a compound statement that calls one of the functions and ends with an exit. Like this:

#!/bin/bash
subroutine() { ... }
main() { ... }
{ main "$@"; exit $?; }

The idea is that the shell doesn't actually _do_ anything while reading this script until it reads the braced compound statement at the end. And then it's committed to exiting during the execution of that statement. So it won't ever read from the script file again.

With a normal shell script, it's dangerous to edit the script file while an instance of the shell is still running it, because the shell will read from the modified version of the file starting at the file position it had got to in the old one, perhaps reading a partial command or the wrong command and doing something you didn't want. But with a script in this style, the shell finishes reading the script before it does anything, so it's safe to edit.

(Of course, if your editor saves the new script file to a different file name and renames it over the top, you're safe anyway. But not all editors do: emacs, in particular, reopens the existing file and overwrites its contents.)

Petite correction des paramètres du #bubblecut, c'est parti pour huit heures de rendu.
ajust parameters of the bubble-cuting sphere · 1b50ba7616

HexaCone - Projet POVray de l'hiver 2024/2025 : un objet hexaconal, prenant en compte les divergences d'opinion.

Tetalab Git Service
La famille #hexacone, du raytracing en #povray : une nouvelle scène http://maison.tth.netlib.re/v/wip-bubblecut.html
Interhackerspace pleroma

Interhackerspace pleroma

@tth : Et on connaitra les dates précises bientôt ? https://wiki.interhacker.space/index.php?title=RAS2025
RAS2025 — Interhack

#Ugly #picture of the day.
Interhackerspace pleroma

Dans les petites séries que j'aurais bien aimé avoir le temps de développer plus : celle de T-shirt 👕
International Open Hackerspace Day 2025 | Tetal@b

Le hackerspace toulousaing' putaing' cong'

Dans l'univers #hexacone, je voudrais le wip...
Interhackerspace pleroma