On Apr 9, 2010, at 12:47 PM, Sravana Kumar wrote: Hi All,
1. In my dummy component package, I am launching an executable present next my preinstall, what is the recommended/suggested way of accessing present working directory in preinstall scripts ? `pwd` or "$PWD" or "." or "$0/../"
I saw safari pkg and foun that it is using `pwd`. I hoping that this will work in all platforms and in all forms of package and will not break in future ?
my $currentDirectory = `pwd`; is a perl statement that calls the shell, executes the unix command pwd, and stuffs the output into the variable $currentDirectory. This can let you find other files "near" the currently-executing one, for whatever reason you have.
Two examples: 1) You have more than one postflight script, or 2) You have a file containing data that the current executing script needs to access.
It is unlikely to break in the future, but note that the organization of packages is different between "flat" packages and "bundle" packages.
And I also commiserate that one used to be able to use $0, and now one must use pwd. |