unix: replace readlink in mkall.sh with portable shell commands

Fixes golang/go#35997

Change-Id: I1c489a126646a0ff4abf9e8b7ba357ff62cb66ac
GitHub-Last-Rev: e01b1c0e8baa28713e7d2235f2f55086a97d709c
GitHub-Pull-Request: golang/sys#49
Reviewed-on: https://go-review.googlesource.com/c/sys/+/210157
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/unix/mkall.sh b/unix/mkall.sh
index 890ec46..fa0c69b 100755
--- a/unix/mkall.sh
+++ b/unix/mkall.sh
@@ -50,7 +50,7 @@
 	# Use the Docker-based build system
 	# Files generated through docker (use $cmd so you can Ctl-C the build or run)
 	$cmd docker build --tag generate:$GOOS $GOOS
-	$cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS
+	$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")" && /bin/pwd):/build generate:$GOOS
 	exit
 fi