Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## add-bin-dir-to-end-of-path [shell] #!/bin/sh # # Adds <current_directory>/bin to end of PATH # unless PATH already contains <current_directory>/bin # # Execute in the current shell (not a subshell) like this: # # source add-bin-to-end-of-path # # or using the alias to source '.' # # . add-bin-dir-to-end-of-path # # The regular expression comparison operator used # below is only available in bash version 3 and later. # # /bin/sh must run bash v3.0 or later for this script to work. # pwd=`pwd` if [[ "$PATH" =~ "$pwd" ]] then return 0 else export PATH=$PATH:$pwd/bin fi
This paste will be private.
From the Design Piracy series on my blog: