25 ms·
Here is another version of 'marks' for Mac OS that aligns the arrows. It also works when 'ls' is aliased. function marks { \ls -l $MARKPATH | tail
by guygurari 13y ago
Here is another version of 'marks' for Mac OS that aligns the arrows. It also works when 'ls' is aliased.
function marks {
\ls -l $MARKPATH | tail -n +2 | sed 's/ / /g' | cut -d' ' -f9- | awk -F ' -> ' '{printf "%-10s -> %s\n", $1, $2}'
}
- 0x09 13y agoIf you are on a system with BSD stat like OS X you can get the same with function marks { (cd $MARKPATH && stat -f"%-10SN%SY" *) } Even better with column (t="$(printf "\t")"; cd $MARKPATH && stat -f"%N$t%SY" * | column -ts"$t")
- flyswatter 13y agoOne more fix... if you have group names with spaces this will throw the field number off and you'll see the modification time preceding the mark name. Adding '-n' to the ls command works around this by causing the group id to be printed instead of the group name and all works, i.e.: \ls -ln "$MARKPATH" | tail -n +2 | sed 's/ / /g' | cut -d' ' -f9- | awk -F ' -> ' '{printf "%-10s -> %s\n", $1, $2}'