It would be
ENV['PATH'] = '/newpath' + ENV['PATH']
and it is as easy as it can get. Not aware about any method like +=.


On Thu, Jan 16, 2014 at 11:43 AM, Previn Lin <lists / ruby-forum.com> wrote:

> As we know, commands below can add new path in the tail of original
> ENV['path'](i.e. /path_old:/path_new)
>
> ENV['PATH'] += ":/path_new"
>
> If I want the new path added in the head of original ENV['path'](i.e.
> /path_new:/path_old), is there quick way simlilar as "+="?
>
> Certainly commands below works, just want to know whether simplified
> command similiar with "+=".
>
> ENV['PATH'] = '/path_new' + ':' + '/path_old'
>
> --
> Posted via http://www.ruby-forum.com/.
>