Skip to content

Instantly share code, notes, and snippets.

@nmcspadden
Created March 17, 2016 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmcspadden/1db5ab3dd4f71a9a7c02 to your computer and use it in GitHub Desktop.
Save nmcspadden/1db5ab3dd4f71a9a7c02 to your computer and use it in GitHub Desktop.
paths_file = File.readlines('/etc/paths').map(&:strip)
[
'/opt/path/to/A',
'/opt/path/to/B',
].each do|path|
paths_file.unshift(path) unless paths_file.include?(path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment