Shell Execute inconsistency

I have a terminal command line in a TextArea. If I try to run this as:

Dim sh as new shell sh.execute(TextArea1.text)
It fails - cannot find the command.

If I copy the TextArea text onto the clipboard and paste it into a terminal window, it works.

Any one know why this is?

OS X ? Windows ? Linux ?
That matters

Usually the issue is that in a Terminal you have a certain environment set up which includes various search paths
The Shell in Xojo does NOT
So you usually have to use fully qualified paths to the application you’re trying to tun

Try pwd and echo $PATH from a Xojo shell for some clues. If the command you’re trying to execute is not in $PATH you can use the full path ie /usr/local/bin/COMMAND. You can use the which command from terminal to determine the location ie ‘which ls’

[quote=271776:@Malcolm Wooden]I have a terminal command line in a TextArea. If I try to run this as:

Dim sh as new shell sh.execute(TextArea1.text)
It fails - cannot find the command.

If I copy the TextArea text onto the clipboard and paste it into a terminal window, it works.

Any one know why this is?[/quote]

Please post the content of TextArea1.Text, it will be easier to see what is going on.

The command in the textfield is wrong or Not exist.
Can you please share the command from the textfield?

I have discovered a reason why this is but I have yet to find a solution.

Xojo Shell Execute command seems to be the same as executing a shell script on MacOSX which requires executable permission (+x). Typing the command directly into the Terminal command line does not require this of course. There seems no way to enable this executable permission, which would be sudo chmod +x <filename> on a .sh file

[quote=272360:@Malcolm Wooden]I have discovered a reason why this is but I have yet to find a solution.

Xojo Shell Execute command seems to be the same as executing a shell script on MacOSX which requires executable permission (+x). Typing the command directly into the Terminal command line does not require this of course. There seems no way to enable this executable permission, which would be sudo chmod +x <filename> on a .sh file[/quote]
Terminal would still require the execute bit be set. You may be able to call the interpreter though…

Try sending this instead.

sh <filename>

Just out of curiosity, where are you putting that script that you need sudo to change the execute bit?