in reply to Re^7: Epoch time conversion script
in thread Epoch time conversion script

Hi anonymous monk Thank you for pointing that out. Here's the result again

# more perl_epoch open my $in, '<', 'jabadm_history' or die "Bummer: $!"; open my $out, '>', 'jabadm.txt' or die "What: $!"; while(my $line = <$in>){ if(my ($epoch) = $line =~ /^#\+(\d+)\s*$/){ my $human_readable = `date -d \@$epoch`; # or: # my $human_readable = scalar localtime $epoch; print $out $human_readable; } else{ print $out $line; } } # ls -lrt jabadm_history -rw-r--r-- 1 jabadm sapsys 1518 Mar 27 13:31 jabadm_history # ./perl_epoch ./perl_epoch: line 1: open: command not found ./perl_epoch: line 2: open: command not found ./perl_epoch: line 4: syntax error near unexpected token `)' ./perl_epoch: line 4: `while(my $line = <$in>){'

Replies are listed 'Best First'.
Re^9: Epoch time conversion script
by Anonymous Monk on Apr 06, 2012 at 04:01 UTC

    Well, perl is not executing that program

    If you're not going to type  perl program you need to set the shebang correctly, for ex  #!/usr/bin/perl --

    More on this in perlrun, Behind the GUI lives the Shell (enable javascript for images)