zoukankan      html  css  js  c++  java
  • u-boot.cfg转eclipse_xml小脚本

    手动复制粘贴版本

    cat u-boot.cfg | awk '{if(length($3)){$3 = substr($0, length($1)+length($2)+3); gsub(""","\&quot;",$3); gsub("<","\&lt;",$3); print "<listOptionValue builtIn="""""false""""" value=""""$2"="$3""""/>"}else{print "<listOptionValue builtIn="""""false""""" value=""""$2""""/>"}}'

    #define CONFIG_SPI_FLASH_WINBOND 1

    <listOptionValue builtIn="false" value="CONFIG_SPI_FLASH_WINBOND=1"/>

    #define CONFIG_ENV_OVERWRITE 

    <listOptionValue builtIn="false" value="CONFIG_ENV_OVERWRITE"/>

    #define CONFIG_FASTBOOT_GPT_NAME "gpt"

    <listOptionValue builtIn="false" value="CONFIG_FASTBOOT_GPT_NAME=&quot;gpt&quot;"/>

    #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + (128 << 20))

    <listOptionValue builtIn="false" value="CONFIG_SYS_SPL_ARGS_ADDR=(CONFIG_SYS_SDRAM_BASE + (128 &lt;&lt; 20))"/>

    自动生成配置文件导入版本

    #!/bin/bash
    cat head.xml
    #cat $1 | awk '{if(length($3)){$3 = substr($0, length($1)+length($2)+3); gsub(""","\&quot;",$3); gsub("<","\&lt;",$3); print "<listOptionValue builtIn="""""false""""" value=""""$2"="$3""""/>"}else{print "<listOptionValue builtIn="""""false""""" value=""""$2""""/>"}}'
    cat $1 | awk '{if(length($3)){$3 = substr($0, length($1)+length($2)+3); gsub("<","\&lt;",$3); print "<macro><name>"$2"</name><value>"$3"</value></macro>"}else{print "<macro><name>"$2"</name><value/></macro>"}}'
    cat central.xml
    #cat $1 | awk '{if(length($3)){$3 = substr($0, length($1)+length($2)+3); gsub(""","\&quot;",$3); gsub("<","\&lt;",$3); print "<listOptionValue builtIn="""""false""""" value=""""$2"="$3""""/>"}else{print "<listOptionValue builtIn="""""false""""" value=""""$2""""/>"}}'
    cat $1 | awk '{if(length($3)){$3 = substr($0, length($1)+length($2)+3); gsub("<","\&lt;",$3); print "<macro><name>"$2"</name><value>"$3"</value></macro>"}else{print "<macro><name>"$2"</name><value/></macro>"}}'
    cat tail.xml

    head.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <cdtprojectproperties>
    <section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
    <language name="C Source File">

    central.xml

    </language>
    <language name="C++ Source File">

    tail.xml

    </language>
    <language name="Object File">

    </language>
    <language name="Assembly Source File">

    </language>
    </section>
    </cdtprojectproperties>

    下载地址

  • 相关阅读:
    散列
    Studio 3T破解方式
    springboot整合elasticsearch时的版本问题:
    ElasticSearch6.4.1 【Rejecting mapping update to [posts] as the final mapping would have more than 1 type】
    IP地址查询API
    拉姆达表达式 追加 条件判断 Expression<Func<T, bool>>
    类 映射 遍历大全
    jquery load(URL,FUNCTION(){}) 异步加载页面
    LINQ to Entities 不识别方法的解决方案
    当实体类属性超多时候 映射给实体类属性赋值(拉姆达+实体类映射)
  • 原文地址:https://www.cnblogs.com/arci/p/10413155.html
Copyright © 2011-2022 走看看