From: efriedNOspam@... (e) Date: 2008-06-28T13:02:35+09:00 Subject: Re: changing the shebang of ruby files best way ? In article <1ij7ltk.jdqdo9zynmjxN%unbewusst.sein@weltanschauung.com.invalid>, unbewusst.sein@weltanschauung.com.invalid (=?ISO-8859-1?Q?Une_B=E9v?= =?ISO-8859-1?Q?ue?=) wrote: >I've a lot of ruby files (grabed from net) having a wrong shebang for my >setup. > >actual shebang is : >#!/usr/bin/ruby -w > >and i need to change it to : >#! /usr/bin/env ruby -w > >that way i'll get the ruby in my PATH and not a fixed ruby. > >what i plan to do : > >detect if the shebang isn't correct and if true : > move the file to a temp directory > create a new with "good" shebang having path/name of the previous > > >remove the tmp dir > >but i wonder, because i know i have to change the first line only, if i >could change the uncorrect file "in place" even if my shebang line is >longer (4 chars) than the preceeding one ???? Just create a symbolic link to /usr/bin and leave the shebang