Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
292 B

  1. #!/bin/sh
  2. # if we got a directory as first param, cd there first:
  3. if [ -d "$1" ]; then
  4. cd "$1"
  5. fi
  6. # probably GNU-dependent
  7. # list (A)lmost all files in
  8. # current dir, sorted by (t)ime,
  9. # and return the first (newest):
  10. basename=`ls -At | head -1`
  11. # get full path:
  12. readlink -f "$basename"