Thanks Fletcher! That worked great! The only remaining problem I had was that
it still threw errors because the enclosing folder had multiple words. However,
once I changed it to a single word, the issue was resolved, and the script
worked as expected.
Kind regards,
Bill Kochman
> On Jul 18,
You can enclose the file name that might have spaces with double quotes.
Changing the sed line to this should work.
sed -i '' "s/#BASENAME#/$filename_woext/g" "$fullfile"
[fletcher]
> On Jul 17, 2025, at 7:20 AM, Bill Kochman wrote:
>
> Hello Fletcher,
>
> I think I have figured out what th
Hello Fletcher,
I think I have figured out what the problem is. Adding set-x didn’t really
help. But, when I tried it this time. it actually worked on 14 files and failed
on 717 others. That was when I realized that all 14 files which were successful
were one-word file names. All the rest are m
The scripts do seem to work for me with a few test files. You could add "set
-x" to the top of the script and it will output all the commands being
executed. That might give you an idea what is going wrong.
processtxt.sh
#!/usr/bin/env bash
set -x
directory="$1/*.txt"
for f in $directory
Greetings List,
I have an old shell script which I needed to use today and ran into a problem
which I haven’t been able to figure out. I still have the BBEdit help file I
wrote for myself years ago, but the instructions don’t seem to be working. I
have two versions of the script, one for .txt f