Newbie problem - Tech support sent me here

265 views
Skip to first unread message

Neill Smith

unread,
Jun 26, 2021, 7:24:32 PM6/26/21
to BBEdit Talk
I recently upgraded  my macOS from High Sierra to Big Sur. A script file that has run for years under BBEdit (and TextWrangler before) has quit working. The script is invoked from within a file [fname].GEO by picking the script from my scripts list in the BBEdit top bar. The script runs a program that reads the [fname].GEO file.

Now the script doesn't run. I get the message

A scripting error has occurred:

sh: /VCTTools/bat/hdbgsub.sh: No such file or directory

This directory does exist. I uninstalled BBEdit and did a clean reinstall. I had to contact BBEdit tech support in order to install the Command Line Tools because old versions of the tools had to be removed manually.

I didn't write the original script. It was created by a colleague years ago. BBEdit tech support recommended that I contact this group.

Thanks,

Neill Smith

@lbutlr

unread,
Jun 26, 2021, 7:54:41 PM6/26/21
to BBEdit Talk
On 26 Jun 2021, at 17:10, Neill Smith <nssmi...@gmail.com> wrote:
> sh: /VCTTools/bat/hdbgsub.sh: No such file or directory
>
> This directory does exist.

Really? At the ROOT LEVEL of your computer there is a directory named /VCTTools/? How did you manage that?

Does the script hdbgsub.sh exist in that folder?

Does whatever tool you are invoking have permission to access that script?

Has the quarantine bit on the script be checked?

Big Sur is much much more secure than High Sierra, and running "unknown" scripts is part of that security.

--
Everywhere is walking distance if you have the time.

Neill Smith

unread,
Jun 26, 2021, 8:30:52 PM6/26/21
to BBEdit Talk
I don't know how  /VCTTools got at the ROOT LEVEL. My company (dead because of Covid) transitioned me from a WinPC to a MacBook Pro back in 2010. All my various tools were translated to the Mac by our then computer Guru. This is my 2nd Mac from 02/2017.  There are 2 scripts involved in this process -- a SCPT file and a SH file.

The script invoked from the BBEdit top bar (menu bar?) is HydroV_dbg.scpt which resides in folder
/Users/neillsmith/Library/Application Support/BBEdit/Scripts

The HydroV_dbg.scpt file invokes the script hdbgsub.sh which resides in folder
/Volumes/Macintosh HD - Data/VCTTools/bat

The file hdbgsub.sh is a translation of a BAT file hdbgsub.bat. This hdbgsub.sh file is the one that invokes a compiled program that reads the GEO file and executes it.

I have no idea if my various tools have the correct permissions and I have never heard of a quarantine bit.

The only editing that I have ever done to these two tools was the SCPT file. I changed all references to TextWrangler to BBEdit when I had to upgrade to BBEdit.

I am not AppleScript savy and I am not BBEdit script savy -- obviously.  I avoided MacOS upgrades as long as I could because going from Sierra to High Sierra was a royal pain. Back then I had knowledgeable coworkers to help me.

Any help will be greatly appreciated.

Thanks,

Neill Smith

eu...@gmx.de

unread,
Jun 27, 2021, 7:47:55 AM6/27/21
to bbe...@googlegroups.com, nssmi...@gmail.com
Hi Neill,

Did you check whether the script file /VCTTools/bat/hdbgsub.sh does exist?

Ulrich

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/a8fc6e58-41f0-4ea1-9180-efea41378b86n%40googlegroups.com.

Neill Smith

unread,
Jun 27, 2021, 9:38:16 AM6/27/21
to BBEdit Talk

Yes it does exist.  I can open that file (and any other SH file) in AppleScript and edit it. I can open it directly using BBEdit but of course it looks like garbage.

This particular setup is from when my former company used Windows. On a WinPC having VCTTools at c:\VCTTools on every computer meant anyone could add a new tool (VCTTools was maintained in a SVN repository) to VCTTools and then everyone could just update their VCTTools copy. No one had to edit paths for their computer.

When we moved to MacOS, VCTTools was placed at the ROOT LEVEL to get the same effect. Files within VCTTools have paths set under this assumption. If VCTTools were a folder under a USER under MacOS, any one updating to the newest version would have to go in and edit paths in a bunch of files.

Neill Smith

unread,
Jun 27, 2021, 9:46:56 AM6/27/21
to BBEdit Talk
In response to Kreme earlier. I checked the permissions on\VCTTools using Get Info. I have had & write permissions. Everyone else has read permissions. The same permissions hold for the SH file hdbgsub.sh.

Is there some other way to check permissions other than Get Info?

Rich Rijnders

unread,
Jun 27, 2021, 9:54:31 AM6/27/21
to BBEdit Talk
You indicate that you jumped from High Sierra to Big Sur.  In between those was Catalina.  In that version Mac OS switched the default script shell from bash to zsh.  There might be an incompatibility in zsh causing your issue.  You can try changing the default shell back to bash or else you can modify your script to call bash explicitly.

ie: modify the HydroV_dbg.scpt script to do: 
   do shell script "/bin/bash /VCTTools/bat/hdbgsub.sh"

will execute the script in bash instead of zsh. 

If you want to modify Mac OS to permanently switch the default shell back to bash, there are plenty of pages to help you: 


HTH
~ Rich

Dmitry Markman

unread,
Jun 27, 2021, 9:59:04 AM6/27/21
to bbe...@googlegroups.com
In order to create links to the folders in / directory

from terminal

man synthetic.conf

you’ll have to restart after editing/creation of the file /etc/synthetic.conf
make sure to use <tab> instead of spaces (auto-expanded tabs option should be off)

you can check permission from terminal

ls -la <path_to_the_file>

you can also try xattr command, sometimes you can see attribute com.apple.quarantine is there
the you could delete it with

sudo xattr -d com.apple.quarantine <path_to_the_file>


hope it will help

dm


Rich Siegel

unread,
Jun 27, 2021, 10:14:14 AM6/27/21
to BBEdit Talk
On 26 Jun 2021, at 19:10, Neill Smith wrote:

> [...]
> A scripting error has occurred:
>
> sh: /VCTTools/bat/hdbgsub.sh: No such file or directory

What is the exact line of AppleScript that is failing? (You can find out
by running the script in the Apple script editor or Script Debugger.)

> This directory does exist.

My guess is that it would have to have been created quite a long time
ago, because on any version of macOS 10.15 or later, "/" is a read-only
file system.

Trying this now:

% mkdir -p /VCTTools/bat/
mkdir: /VCTTools/bat/: Read-only file system

I suspect that your script's inability to locate
"/VCTTools/bat/hdbgsub.sh" is related to an intersection of the
security-related file system changes and application sandboxing
(specifically of the scripting system). Unfortunately I cannot speculate
as to the precise cause without a lot more details.

> Yes it does exist. I can open that file (and any other SH file) in
> AppleScript and edit it. I can open it directly using BBEdit but of
> course it looks like garbage.

What does that mean, specifically? Are you using ".sh" as a filename
extension for AppleScript files?

> When we moved to MacOS, VCTTools was placed at the ROOT LEVEL to get
> the same effect. Files within VCTTools have paths set under this
> assumption.

I recommend reconsidering this decision, if possible. There are many
global Unix directories available on macOS which are fit for purpose,
none of which will get you tangled up in the macOS security model.

For example, you could mandate "/usr/local/VCTTools" as the "root"
location when on macOS, and you'll get your desired behavior of being
able to have a machine-wide installation. It might even solve your
issue, although I unfortunately am still not clear on what the
underlying cause actually is.

R.

--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.

Neill Smith

unread,
Jun 27, 2021, 10:34:51 AM6/27/21
to BBEdit Talk
I need to learn to proof better. I have read & write permissions on all files and folders.

Dmitry Markman

unread,
Jun 27, 2021, 10:44:33 AM6/27/21
to bbe...@googlegroups.com
as I said in my previous email

check com.apple.quarantine with xattr

if it’s there you should delete it with sudo xattr -d com.apple.quarantine <path>

also as Rich Siegel noticed you should avoid put links in / folder, however it’s possible, using /etc/synthetic.conf.

it’s not recommended, there are situations when you have to do that to avoid very expansive refactoring



dm

Neill Smith

unread,
Jun 27, 2021, 10:58:45 AM6/27/21
to BBEdit Talk
In reply to Rich, I executed a Terminal command that I found online yesterday to get back to bash. The response that I got was "No changes" so I don't know if I am running bash or not. How do I tell?

Will respond to other responses later. Gotta go get sick wife breakfast.

Thanks,

Neill

Neill Smith

unread,
Jun 27, 2021, 12:36:17 PM6/27/21
to BBEdit Talk
Further information. I suspect you all are correct about a security file system problem.

As I noted earlier, the BBEdit script HydroV_dbg.scpt  is invoked from within BBEdit from a GEO file. The BBEdit SCPT file in turn invokes the AppleScript file hdbgsub.sh. This script file runs a compiled program HydroV that reads the GEO file and outputs a slew of files that are then used by other compiled programs.

The reason for executing the GEO file from within BBEdit is to make sure it is correct. Part of the BBEdit SCPT file opens the OUT file produced by HydroV so that it can be checked.

Once a GEO file is correct, a number of Matlab programs use it. These Matlab codes directly run the AppleScript file hdbgsub.sh with the GEO file as the input. Other programs are then run under Matlab from the output files that are created by running the GEO file.

Now the Matlab file that runs the AppleScript SH file hdbgsub.sh directly is called rung.m
This file works under either the Mac OS or the Win OS. A piece of the code from rungeo.m is shown below.

if ismac

    slash = '/';

    root = 'bash ';

    ext = '.sh';

else

    slash = '\';

    root = 'C:';

    ext = '';

end

[Hstat Hmsg] = system([root,slash,'VCTTools',slash,'bat',slash,'hdbgsub',ext,' ',filename]);



Basically, this snippet either calls  hdbgsub.sh or  hdbgsub.bat depending on the OS.

This is a long winded way to get to my new info.

I directly ran rungeo.m so that it would go directly to hdbgsub.sh. I got the following message.

bash: /VCTTools/bat/hsub.sh: No such file or directory

If I try to CD from my test directory to /VCTTools directly I get

K>> cd

/Users/neillsmith/NSS_Office/Veh/Low_Re_Tests

K>> cd /VCTTools
Error using cd
Cannot CD to /VCTTools (Name is nonexistent or not a directory).

So in Finder I can get to /VCTTools and edit files. BBEdit can open files under /VCTTools and edit them.
But other programs don't see this directory /VCTTools.

So what is the best fix that doesn't involve a lot of path edits and break the simple SVN update process?

I really appreciate all of your help.

Neill

Neill Smith

unread,
Jun 27, 2021, 12:59:12 PM6/27/21
to BBEdit Talk
In response to Dimitry I ran the following in Terminal

Neills-MacBook-Pro:~ neillsmith$ ls -la /VCTTools

ls: /VCTTools: No such file or directory

Neills-MacBook-Pro:~ neillsmith$ xattr /VCTTools

xattr: No such file: /VCTTools


Did I do this correctly?

Neill

Rich Siegel

unread,
Jun 27, 2021, 1:09:51 PM6/27/21
to BBEdit Talk
On 27 Jun 2021, at 12:36, Neill Smith wrote:

> K>> cd /VCTTools
> Error using cd
> Cannot CD to /VCTTools (Name is nonexistent or not a directory).
>
> So in Finder I can get to /VCTTools and edit files. BBEdit can open
> files
> under /VCTTools and edit them.
> But other programs don't see this directory /VCTTools.

Perhaps you and the Finder have a different idea of where that folder
is.

Try this:

- open a new Terminal window.

- type "ls -laeO " (including the space), but do NOT press Return or
Enter.

- drag the "VCTTools" folder from the Finder *into* the Terminal window.
This will enter the full path to the folder.

- now press Return.

At step 3 you'll see the actual Unix path to the "VCTTools" folder, and
that perhaps may explain why Terminal and Finder don't agree.

Then supply the output from the "ls" command, since that may hold some
clues as well.

jj

unread,
Jun 27, 2021, 1:12:27 PM6/27/21
to BBEdit Talk
Hi Neill,

I notice that the scripting error you describe in your first post is:

>    A scripting error has occurred:
>    sh: /VCTTools/bat/hdbgsub.sh: No such file or directory

Yet in another post you add:
    
>    The HydroV_dbg.scpt file invokes the script hdbgsub.sh which resides in folder
>    /Volumes/Macintosh HD - Data/VCTTools/bat

Since macOS Catalina, MacOS now splits the operating system and data files into two volumes.


So hdbgsub.sh was probably moved to the data files when you upgraded you system and is accessible at:
    
    /Volumes/Macintosh HD - Data/VCTTools/bat/hdbgsub.sh
    
Consequently you should replace the old path by this new path in the script that calls hdbgsub.sh.

[Hstat Hmsg] = system([root,slash,'Volumes',slash,'Macintosh HD - Data',slash,'VCTTools',slash,'bat',slash,'hdbgsub',ext,' ',filename]);
    
HTH

Jean Jourdain

Neill Smith

unread,
Jun 27, 2021, 1:42:59 PM6/27/21
to BBEdit Talk
Thanks to Rich and Jean I "think" we have found the problem. When I went to execute the Terminal commands suggested by Rich I couldn't find the /VCTTools folder in Finder to drag it to the Terminal window.

I can get to /VCTTools because I had a shortcut to it in the LHS panel of Finder where you save links to often-used folders. I have been clicking that link to get to /VCTTools. When I do, the path shown is

/Volumes/Macintosh HD - Data/VCTTools

which Jean noticed. If I paste the above path into the Terminal commands suggested by Rich I get

Neills-MacBook-Pro:~ neillsmith$ ls -laeO /Volumes/Macintosh HD - Data/VCTTools

ls: -: No such file or directory

ls: /Volumes/Macintosh: No such file or directory

ls: Data/VCTTools: No such file or directory

ls: HD: No such file or directory

Neills-MacBook-Pro:~ neillsmith$ 


If I click "back" when at the/VCTTools folder via my saved Finder link, I end up at

               Macintosh HD without /Volumes as part of the path.

 I see folders

              Applications, System, Users

I see a lot of grayed-out entries including

             Volumes

If I double-click Volumes, I see two folders

              Mackintosh HD (has different icon, might not be a folder)

              Mackintosh - Data

If I double-click Mackintosh - HD, I see the folder VCTToolds.

So VCTTools is not where  thought it was. 

So how and where do I move VCTTools?


Thanks,

Neill

jj

unread,
Jun 27, 2021, 1:57:23 PM6/27/21
to BBEdit Talk
Neill,

The path /Volumes/Macintosh HD - Data/VCTTools contains spaces.
You should quote paths that contains spaces when using them in the terminal, like so:
    "/Volumes/Macintosh HD - Data/VCTTools"

Otherwise the shell interprets it as 4 paths space separated: 
 /Volumes/Macintosh
HD
-
Data/VCTTools

Neill Smith

unread,
Jun 27, 2021, 2:24:37 PM6/27/21
to BBEdit Talk
When I put quotes around the path I get the following:

Neills-MacBook-Pro:~ neillsmith$ ls -laeO "/Volumes/Macintosh HD - Data/VCTTools"

total 32

drwxr-xr-x   9 neillsmith  wheel  -        288 Mar 23  2018 .

drwxr-xr-x   3 root        wheel  -         96 May 16 16:08 ..

-rw-r--r--@  1 neillsmith  wheel  hidden 14340 Jun 27 13:11 .DS_Store

drwxr-xr-x   9 neillsmith  wheel  -        288 Mar 10  2018 .svn

drwxr-xr-x  36 neillsmith  wheel  -       1152 Mar 10  2018 Etc

drwxr-xr-x  61 neillsmith  wheel  -       1952 Sep 27  2020 Exe

drwxr-xr-x   6 neillsmith  wheel  -        192 Dec 14  2017 MacBin

drwxr-xr-x  47 neillsmith  wheel  -       1504 Apr 15  2020 Matlab

drwxr-xr-x  35 neillsmith  wheel  -       1120 Dec 19  2019 bat

Neills-MacBook-Pro:~ neillsmith$ 


What the heck is wheel?

Neill

jj

unread,
Jun 27, 2021, 2:41:21 PM6/27/21
to BBEdit Talk
The output of the ls  -laeO command you runned can be read as:
permissions - links - owner - group - date - file

So 'wheel' is the group.

If you run 

 ls -laeO "/Volumes/Macintosh HD - Data/VCTTools/bat"

your script should appear in the listing.

Dmitry Markman

unread,
Jun 27, 2021, 2:52:56 PM6/27/21
to bbe...@googlegroups.com
just run from terminal

ls -la

if you don’t see VCTTolls there then it’s not there, obviously


as far as I remember when you upgrade to 10.15 all not system folders in the root were moved to the folder

/Users/Shared/Relocated Items


also you should check folder /System/Volumes/Data not /Volumes/


/System/Volumes/Data - is a mounting point to the volume "Macintosh HD - Data”

hope it will help

dm


Reply all
Reply to author
Forward
0 new messages