如何从 shell 脚本运行 MAGMI


How to run MAGMI from a shell script

我尝试从shellscript运行MAGMI,但我得到相同的消息:

/bin/sh:/is/htdocs/XXXXXXXXXX/

magento/magmi/cli/XXXXXXX.sh:/bin/bash^M: 糟糕的解释器: 没有这样的文件或目录

我的脚本:

 #!/bin/bash
FILES=/is/htdocs/XXXXXXXXX/magento/var/import/XXXXXXXXX.csv
for f in $FILES
do
     echo "Running Magmi update with file: $f"
     php magmi.cli.php -profile=XXXX -mode=update -CSV:filename="${f}"
     wait
done

该脚本与 magmi.cli 位于同一目录中.php

感谢您的提示和解决方案!

请使用dos2unix linux命令删除上述错误,例如:

 dos2unix scriptfilename.sh scriptfilename.sh

它通常发生在我们在WINDOW eniv中编写一些东西然后转移到Linux平台时。