Hacker News new | comments | show | ask | jobs | submit login

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}'
    }



If 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")


One 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}'




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: