简体   繁体   English

如何从Shell脚本运行MAGMI

[英]How to run MAGMI from a shell script

I try to run MAGMI from a shellscript, but I get allways the same message: 我尝试从shellscript运行MAGMI,但始终收到相同的消息:

/bin/sh: /is/htdocs/XXXXXXXXX/magento/magmi/cli/XXXXXXX.sh: /bin/bash^M: bad interpreter: No such file or directory / bin / sh:/is/htdocs/XXXXXXXXX/magento/magmi/cli/XXXXXXX.sh:/ bin / bash ^ M:错误的解释器:无此类文件或目录

My script: 我的剧本:

 #!/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

The script is in the same directory as magmi.cli.php 该脚本与magmi.cli.php位于同一目录中

Thanks for hints and solutions ! 感谢您的提示和解决方案!

Please use dos2unix linux command to remove above error like: 请使用dos2unix linux命令删除上述错误,例如:

 dos2unix scriptfilename.sh scriptfilename.sh

it generally occurs when we written something in WINDOW eniv. 通常在我们用WINDOW eniv编写某些内容时会发生这种情况。 & then transfer to Linux platform 然后转移到Linux平台

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM