Skip to content

Instantly share code, notes, and snippets.

@nmcspadden

nmcspadden/sample.rb

Created Mar 17, 2016
Embed
What would you like to do?
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