title: Can't exec "history": No such file or directory at gatherinformation.pl line 7
body: <p>I'm trying to call "history" from a perl script but it keeps saying "Can't exec "history": No such file or directory at gatherinformation.pl line 7." Script:</p>
  
  <pre><code>#!/usr/bin/perl
  
  use strict;
  use warnings;
  
  open(my $fich ,"&gt;&gt;/home/osboxes/Desktop/ConteudosServer/Plano de contingencia/history_report.txt");
  `history`;
  </code></pre>
  
  <p>I have tried only using <code>history</code> in the script but it keeps giving me the same error.</p>
  
  <p>I'm have been messing around with the HISTFILESIZE and HISTFILE variables to output "%h/%d -- %H:%M:%S ". 
  Heres is the line in the bashrc file:</p>
  
  <pre><code>export HISTTIMEFORMAT="%h/%d -- %H:%M:%S "
  </code></pre>
  
  <p>I have tried both of these answers:
  <a href="https://stackoverflow.com/questions/14032741/cant-exec-no-such-file-or-directory">Can&#39;t exec No such file or directory</a></p>
  
  <p><a href="https://stackoverflow.com/questions/11984725/perl-script-error-cant-exec-module-no-such-file-or-directory-at-prog-line">perl script error: Can&#39;t exec &quot;module&quot;: No such file or directory at ./prog line 2</a></p>
  
  <p>I don't think it's usefull to start another question just to ask this: is there a way to get the <code>history</code> directly from the file <code>./bash_history</code> with date and time? I don't think it's usefull having to call shell commands to such a simple task.</p>