vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 659decf64fa2f5c9df1fd422c05cdad6eae840bc parent c73efb2ab06f90e0198401d28bc03da285873fc2 Author: Tim Allen <screwtape@froup.com> Date: Sat, 28 May 2016 18:01:17 +1000 [vis-open] Don't use realpath(1). Despite how useful realpath is, apparently it's not POSIX and isn't part of the BSD userland. Diffstat:
| M | vis-open | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vis-open b/vis-open @@ -50,7 +50,8 @@ if [ $# -eq 1 -a "$ALLOW_AUTO_SELECT" = 1 ]; then else # We've found a single item, and it's not a directory, # so it must be a filename (or file-like thing) to open. - echo $(realpath "$1") + cd "$(dirname "$1")" + echo "$(pwd -P)"/"$(basename "$1")" exit 0 fi fi