Pass string to shell command

I am very new to Xojo but have been writing shell scripts for years. I am trying to figure out how to pass a user defined string to a shell command.

For example, let’s say I want to write a desktop program that will ping an address (IP or FQDN) to see if the server is up. I do not want the user to have to type out the ping command (ping -o -t 5), just the address. How would I go about doing this?

I figured it out while looking at other users conversations.

In case anyone wants to know.
(The AddressField is a text field that contains the address the OutputArea shows the results)

[code] Dim sh As New Shell

dim command, address, result as string

address = AddressField.Text
command = "ping -o -t 5 " + address

sh.Execute(command)
OutputArea.Text = sh.Result[/code]

Be sure to check the Shell ErrorCode too to make sure there wasn’t an error.

Depending on the system, you might need use the full path to the command. On the Mac, that’s /sbin/ping in this case.

Not long ago this was asked: https://forum.xojo.com/10841-pinging-multiple-stations-as-fast-as-possible/p1#p77874

Thanks for the advice. This was just an example, what I am doing is much more complicated and over time will be moved way from the shell as I learn more programming.