Send IPC via Bash Script to Console app

I want to send notification data via IPC to a console app.
I will often use scripts to simplify status notifications, from watch folders to NetworkManager. At the moment, I use timers to periodically check a status, which works, but I would prefer to ditch timers altogether if possible.

#!/bin/bash

fifo_name="/tmp/com.scripttest.com"

# Open the fifo in write-only mode
fifo_fd = open(fifo_name, "w")

# Write to the fifo
write(fifo_fd, "Hello, world!")

# Close the fifo
close(fifo_fd)

I haven’t gotten anywhere with this script, even when I’ve confirmed that my console app is listening.
I use IPC to communicate between console apps often; it’s clean and very efficient.

In the meantime, I’ve created a similar test with UDP communication and it does work, keeping communication limited to localhost. Still, I’d like to get IPC working if not but for the sake of my own sanity.
Has anyone managed to do this?

It’s been a while since I worked with FIFOs. I wonder if closing the FIFO will destroy it, then the Console app can’t read anything.

I have no idea. FIFO fails on open.

fifo_fd = open(fifo_name, "w")