local args = {...}
if #args == 0 then
error("usage: which <program>", 0)
end
local result = shell.resolveProgram(args[1])
if result == nil then
error(table.concat {
'"',
args[1],
'" not found'
}, 0)
end
write '/'
print(result)
Comments