Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 23 |
Nodes: | 6 (0 / 6) |
Uptime: | 40:47:52 |
Calls: | 583 |
Calls today: | 1 |
Files: | 1,138 |
Messages: | 110,394 |
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: