我尝试从 shellscript 运行 MAGMI,但我总是得到相同的消息:
/bin/sh:/is/htdocs/XXXXXXXXX/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平台
关于php - 如何从 shell 脚本运行 MAGMI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28957772/