#DOCUMENTATION by cg
class: UnixOperatingSystem
comment/format in: #pathOfCommand:
--- a/UnixOperatingSystem.st Tue Sep 27 14:54:20 2016 +0200
+++ b/UnixOperatingSystem.st Tue Sep 27 14:56:57 2016 +0200
@@ -3815,16 +3815,20 @@
commandFilename := aCommand asFilename.
commandFilename isAbsolute ifTrue:[
+ "/ something like "/foo/...", tried path is it
^ commandFilename pathName
].
commandFilename isExplicitRelative ifTrue:[
+ "/ something like "../foo/...", tried path resolved relative to the current directory
^ commandFilename pathName
].
(aCommand includes:$/) ifTrue:[
- "/ something like "smalltalk/stx", if executed from a parent directory
+ "/ something like "smalltalk/stx", tried path is relative to the current directory
^ ('./',aCommand) asFilename pathName
].
+ "/ command is a single word, not relative and not absolute.
+ "/ search along PATH environment variable to see what a shoell would do.
path := self getEnvironment:'PATH'.
path notEmptyOrNil ifTrue:[
(path asCollectionOfSubstringsSeparatedBy:self pathSeparator) do:[:eachPathComponent |