-
-
Save LeetCodes/009971dcfa22db0486a782931da763ab to your computer and use it in GitHub Desktop.
Revisions
-
jpaugh created this gist
Sep 6, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ if _BASHRC_WAS_RUN 2>/dev/null; then :; else # Stuff that only needs to run the first time we source .bashrc. # Useful to allow re-sourcing new changes, without breaking/changing things in this section alias _BASHRC_WAS_RUN=true # ... continued ... fi # Last mod time of a file or files get_file_timestamp () { ls -1 --time-style=+%s -l "$@" | cut -f6 -d" " } # Make sure our version of the .bashrc file is up-to-date, or reload it. chk_bashrc_timestamp () { if [[ "$_BASHRC_TIMESTAMP" -lt "$(get_file_timestamp "$HOME/.bashrc")" ]]; then echo >&2 "Reloading .bashrc..." . ~/.bashrc fi } _BASHRC_TIMESTAMP=$(date +%s) prompt_cmd () { chk_bashrc_timestamp } PROMPT_COMMAND=prompt_cmd # some ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' # ... continued ...