jimmy wrote:
im trying to run a perl script inside a bash script. i've been searching for guides/references and read the Advanced Bash Scripting Guide. But it doesn't clearly explain how to include complex perl commands in a bash script. i've managed to reach upto this point ,
Code:
perl -e 'use File::stat;
use Time::localtime;
$file='/mnt';
$date_string = ctime(stat($file)->mtime);
print "file $file updated at $date_string\n";'
So u see, im trying to search for files created today. But when i try to run the script , i get error "search field incomplete".
Please help.
You forgot to escape your quotation mark. Bash sees this:
Code:
perl -e 'use File::stat;
use Time::localtime;
$file='
Solution:
Code:
$file=\'/mnt\';
OR
Code:
$file="/mnt";
But as iccus said, bash would be better for this particular task
