chenjiali 发表于 2018-9-1 08:44:21

crontab中脚本调用perl

  在crontab中调用shell脚本,shell脚本中有perl程序,会有无法正确执行的问题,在shell脚本中加入红色部分,暂解决问题。
  #!/bin/bash
  source ~/.bash_profile
  /usr/bin/perl /opt/perl.pl
  root#crontab -l
  1 * * * * /opt/shell.sh
  shell与perl编程差的还远哦,因为perl所使用的环境变量为系统的环境变量,而crontab在运行时不使用当前系统的环境变量。

页: [1]
查看完整版本: crontab中脚本调用perl