2017-02-20 29 views
0

我正在嘗試創建一個.sh文件,該文件在內部運行一個修補程序。因此,我不希望在腳本旁邊運行修補程序文件patch -p0,而是要將修補程序嵌入到腳本中。在sh文件中嵌入修補程序文件

我試過下面

patch -p0 <<EOF 
Index: app/code/Magento/CustomerImportExport/Model/Import/Customer.php 
IDEA additional info: 
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP 
<+>UTF-8 
=================================================================== 
--- app/code/Magento/CustomerImportExport/Model/Import/Customer.php  (date 1487543450000) 
+++ app/code/Magento/CustomerImportExport/Model/Import/Customer.php  (revision) 
@@ -371,6 +371,7 @@ 
     // attribute values 
     foreach (array_intersect_key($rowData, $this->_attributes) as $attributeCode => $value) { 
      if ($newCustomer && !strlen($value)) { 
+        $entityRow[$attributeCode] = $value; 
       continue; 
      } 

EOF 

但它不工作。但是,當我在原始補丁文件上運行patch -p0時,它可以正常工作。任何線索可能是錯誤的?

感謝,

回答