pastebin - collaborative debugging tool RSS

Posted by Anonymous on Mon 8th Feb 2016 16:20
raw | new post

  1. # Fix tmux resurrect files, but only if resurrect files have already been restored!
  2. shopt -s nullglob dotglob
  3. files=(~/.tmux/resurrect/*)
  5. if (( ${#files[*]} ))   ## First check whether directory is empty, and if it is not, then abort.
  6.         then
  7.                 if
  8.                 f() { local F; for F; do [[ -L $F ]] || return 1; done; return 0; }; f ~/.tmux/resurrect/*  ## If it's not empty, check whether it contains only symlinks.
  9.                         then bash ~/env_deploy/  ## If it contains only symlinks, run that script.
  10.                         else echo "Don't forget to restore tmux-resurrect files!"
  11.                 fi
  12.         else echo "Directory not empty, aborting..." && exit 1
  13. fi
  15. shopt -u nullglob dotglob

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}

All content is user-submitted.
The administrators of this site ( are not responsible for their content.
Abuse reports should be emailed to us at