tisonkun commented on code in PR #16332:
URL: https://github.com/apache/pulsar/pull/16332#discussion_r922297527


##########
bin/pulsar-shell:
##########
@@ -18,7 +18,19 @@
 # under the License.
 #
 
-BINDIR=$(dirname "$0")
+# need this for relative symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG="`dirname "$PRG"`/$link"
+  fi
+done

Review Comment:
   Actually I'm working on providing a root level symbol link to the 
distribution in our workspace so that developers can easily play with latest 
Pulsar on their branch. In that scenario other scripts may need to resolve 
symlink also.
   
   But if we just symlink the parent directory, it seems not need for resolve 
the script itself. This script works when the script is directly symlinked, 
doesn't it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to