On 28/4/13 at 01:49, [email protected] (LuKreme) wrote:

I knew I was going to hate python, and I do. My script was failing because there were spaces indenting a line instead of a tab.

I finally, after much struggling, ended up with this:

#!/usr/bin/python ...

Now, one other thing, if I wanted to execute the touch command
(I don't, in this case), could I do that within the python via some
sort of exec() function?

I'm guessing that the Perl you need is _something_like_ the script below, which could be made much shorter using a module.

To execute the shell command, just insert
     chomp; `$_`;
after print;


#!/usr/bin/perl
use strict;
while (<>) {
    my ($n, $f) = split / /, $_;
    my $u_seconds = ($n - 719162) * 86400;
    my ($d, $m, $y) = (localtime($u_seconds))[3,4,5];
    my $cmd = join "",
        ("touch -ct ",
        $y +=1900,
        sprintf("%02d", $m),
        sprintf("%02d", $d),
        "0001");
    s/$n/$cmd/;
    print;
}

#JD



--
--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to