Update 'tildepath.sh'
This commit is contained in:
parent
be8dbd51e8
commit
ead0f51840
11
tildepath.sh
11
tildepath.sh
|
@ -1,11 +1,12 @@
|
|||
#!/bin/sh
|
||||
if test "$1";then
|
||||
if test "$1" = "--help";then
|
||||
dir=${1:-"$PWD"} busybox sh -c '
|
||||
if test "$dir";then
|
||||
if test "$dir" = "--help";then
|
||||
echo "replaces /home/ with ~ making friendlier paths.";
|
||||
echo "files relative to current directory";
|
||||
else
|
||||
lsopt="-d1f";ls="$1";
|
||||
true
|
||||
fi;
|
||||
else lsopt="-f1";ls="./";
|
||||
fi
|
||||
ls $lsopt "$ls"|rev|cut -f1 -d" "|rev|sed -e "s\\^\\$PWD/\\" -e 's./home/.~.'
|
||||
dir="${dir:-"$PWD"}";ls -d1p "$dir"|sed -E -e "s\`^[^/]\`$PWD/&\`" -e "s.^/home/$USER.~." -e "s.^/home(/|).~."
|
||||
'
|
Loading…
Reference in New Issue