write it to where?
the same way you'd write anything else?
python 2 is removed from my distro and i used 2to3 python module to convert some scripts but it is lame about first line of them #!... so i need to just write '3' at a fixed offset of some files.
sed is better for that
just tried it, it can't write to an offset(? or i don't know how) tried to change first line with this py="#!/usr/bin/env python" sed -i "1s/.*/$py/" file but i see this error "unknown option to s" don't know what is wrong.
remove the 1 before s
that is the line number
you don't put that there
post the first line of the file as it is now, and how you'd want it to be
first line is #!/usr/bin/env python2 i want #!/usr/bin/env python or #!/usr/bin/env python3
Обсуждают сегодня