[squeak-dev] wildcard expansion with OSProcess outputOf: through ssh
ma.chris.m at gmail.com
Tue Jul 5 23:19:29 UTC 2022
In my bash shell, it correctly produces a list of 3 MAC addresses (one
for each network interface).
ssh myserver cat "/sys/class/net/*/address"
The quotes are needed by the bash shell because of the way it expands
the *. Okay, no problem so far.
When I try to run the exact command above through OSProcess outputOf:,
I get an empty String.
OSProcess outputOf: 'ssh myserver "cat /sys/class/net/*/address"'
"^^^ answers empty String"
If I remove the quotes, I get only the LAST MAC address of the output
as in bash (instead of all 3):
OSProcess outputOf: 'ssh myserver cat /sys/class/net/*/address'
"^^^ answers '00:00:00:00:00:00
And, finally, if I target the same command to my local laptop (without
ssh prefix), then it works, I get the exact same output as from bash.
OSProcess outputOf: 'cat /sys/class/net/*/address'
The issue appears to be related to wildcard expansion when ssh is used
to execute remotely..
Any advice would be greatly appreciated.
More information about the Squeak-dev