View Full Version : Great idea for any software programmers
Nick
January 17th, 2001, 22:37
I just had this kickass idea! Someone should write a program that changes the seebang line (#!/usr/bin/perl) in perl in multiple documents in seconds.
Look at it this way: have you ever tried to install ikonboard on Hypermart? You have to open like twenty some files and change #!/usr/bin/perl to #!/usr/local/bin/perl. This is annoying as hell!
Now just think if you had a small program that changed all those shebang lines in a matter of seconds. That would be the most kickass program ever.
Would someone who knows how to program software please make a program like this? Please :D :D :D?
Canuckkev
January 17th, 2001, 23:51
I had a program a while ago called BK Replace EM. Here is the link from download.com:
http://download.cnet.com/downloads/0-4003619-100-881501.html?tag=st.dl.10001-103-1.lst-7-1.881501
It worked pretty good too. And it's freeware!
cds
January 18th, 2001, 00:06
If you really want one, I suppose I could write one for you... (or someone else on this board)
This is incredibly easy to write with PHP or even PERL so anyone can do it... (I will be busy for about another week or so doing a few more sites...)
Nick
January 18th, 2001, 18:09
Originally posted by cds
This is incredibly easy to write with PHP or even PERL so anyone can do it...
Yes, if I wanted it in PHP or Perl I'd write it myself, but I want to have it on my computer so I can work on road trips and stuff...
chrisabrooks
January 18th, 2001, 18:54
If you have perl for Win32 (I assume you're on Windows?), you can easily run your perl scripts from your computer. Pretty easy to do, then! :)
Jerry
January 19th, 2001, 03:22
unix only (i think.. grep is a unix command):
#!/usr/bin/perl
$shebang = "#!/usr/bin/perl";
opendir DIR, ".";
my @files = grep /\.(pl|cgi)$/, readdir DIR;
closedir DIR;
foreach (@files) {
open FILE, "<./$_";
$first = <FILE>;
if ($file =~ /^#!/) {
$output = "$shebang\n";
while (<FILE>) { $output .= $_; }
close FILE;
open FILE, ">./$_";
print FILE $output;
close FILE;
}
}
test that out.. made it up on the spot.. try it in a directory with 1 pl or cgi file.. and if it works.. then i'm pretty sure it'll work in any case.. it doesn't go up directories.. ie: if you put it in cgi-bin.. it won't go up to cgi-bin/whatever.. its just a few changes to build a directory tree though.. there is a standard perl module to do it..
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.