I was trying to write a Bash script to clean up the old checkpoints in....
my Jupyter notebooks directories, which have been accumulating for
some years. The first version looked like this:
but it didnt work. I figured out that the BASEDIR and CHECKPOINTSDIR >variables were not being properly expanded inside the coproc command.
If I substitute those values literally
coproc collector { find ~/Documents/Jupyter\ Notebooks/ -type d -name
.ipynb_checkpoints -print0; }
then it works.
How would I pass variables into that coproc command?
Try:
mapfile -t < <(find "$BASEDIR" -type d -name "$CHECKPOINTSDIR")
Note: This will fail if you have directory names with newlines in them,
On 2025-08-22, Kenny McCormack <gazelle@shell.xmission.com> wrote:
Try:
mapfile -t < <(find "$BASEDIR" -type d -name "$CHECKPOINTSDIR")
Note: This will fail if you have directory names with newlines in them,
mapfile -d '' -t < <(find ... -print0)
I was trying to write a Bash script to clean up the old checkpoints in
my Jupyter notebooks directories, which have been accumulating for
some years. The first version looked like this:
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 19:05:09 |
| Calls: | 117 |
| Calls today: | 117 |
| Files: | 367 |
| D/L today: |
547 files (254M bytes) |
| Messages: | 70,845 |
| Posted today: | 26 |