shell 中长命令的换行处理
考察下面的脚本: emcc -o ./dist/test.html --shell-file ./tmp.html --source-map-base dist -O3 -g4 --source-map-base dist -s MODULARIZE=1 -s "EXPORT_NAME=\"Test\"" -s USE_SDL=2 -s LEGACY_GL_EMULATION=1 --pre-js ./pre.js --post-js ./post.js --cpuprofiler --memoryprofiler --threadprofilermain.cpp 这里在调用 换行可通过加 改造后看起来像这样,一个参数占一行: emcc -o ./dist/test.html\--shell-file ./tmp.html\--source-map-base dist\-O3\-g4\--source-map-base dist\-s MODULARIZE=1\-s "EXPORT_NAME=\"Test\""\-s USE_SDL=2\-s LEGACY_GL_EMULATION=1\--pre-js ./pre.js\--post-js ./post.js\--cpuprofiler\--memoryprofiler\--threadprofiler\main.cpp 注释通过 emcc -o ./dist/test.html\ # 目标文件--shell-file ./tmp.html\ # 模板文件--source-map-base dist\-O3\-g4\--source-map-base dist\-s MODULARIZE=1\-s "EXPORT_NAME=\"Test\""\-s USE_SDL=2\-s LEGACY_GL_EMULATION=1\--pre-js ./pre.js\--post-js ./post.js\--cpuprofiler\--memoryprofiler\--threadprofiler\main.cpp 这样会导致整个 shell 脚本解析失败。 实测发现,也不能这样: emcc -o\# 目标文件./dist/test.html\ # 模板文件--shell-file ./tmp.html\--source-map-base dist\-O3\-g4\--source-map-base dist\-s MODULARIZE=1\-s "EXPORT_NAME=\"Test\""\-s USE_SDL=2\-s LEGACY_GL_EMULATION=1\--pre-js ./pre.js\--post-js ./post.js\--cpuprofiler\--memoryprofiler\--threadprofiler\main.cpp 同样会导致解析失败。 说到底,通过 但也不是没办法添加注释了,几经周转发现如下写法是可行的: emcc -o ./dist/test.html `# 目标文件` \--shell-file ./tmp.html `# 模板文件` \--source-map-base dist `# source map 根路径` \-O3 `# 优化级别` \-g4 `# 生成 debug 信息` \--source-map-base dist\`# -s MODULARIZE=1\`-s "EXPORT_NAME=\"Test\""\-s USE_SDL=2\-s LEGACY_GL_EMULATION=1\--pre-js ./pre.js\--post-js ./post.js\--cpuprofiler\--memoryprofiler\--threadprofiler\main.cpp 即通过 进一步,解决了注释的问题,如果我们不想要某一行,同时又不想删除,可以像下面这样来注释: emcc -o ./dist/test.html `# 目标文件` \--shell-file ./tmp.html `# 模板文件` \--source-map-base dist `# source map 根路径` \-O3 `# 优化级别` \-g4 `# 生成 debug 信息` \--source-map-base dist\-s MODULARIZE=1\-s "EXPORT_NAME=\"Test\""\-s USE_SDL=2\-s LEGACY_GL_EMULATION=1\`# --pre-js ./pre.js`\--post-js ./post.js\--cpuprofiler\`# --threadprofiler`\--memoryprofiler\main.cpp |
转载于:https://www.cnblogs.com/Wayou/p/line_break_for_long_shell_command.html
shell 中长命令的换行处理相关推荐
- linux中的shell有printf吗,Linux Shell系列教程之(八)Shell printf命令详解
在上一篇:Linux Shell系列教程之(七)Shell输出这篇文章中,已经对Shell printf命令有了一个简略的介绍,本篇给大家详细介绍下Shell中的printf命令. 一.Shell p ...
- 在shell脚本中没有换行符的#39;echo#39;
本文翻译自:'echo' without newline in a shell script I have a problem with echo in my script: 我的脚本中存在echo问 ...
- Linux Shell脚本入门教程系列之(八)Shell printf命令详解
本文是Linux Shell脚本系列教程的第(八)篇,更多shell教程请看:Linux Shell脚本系列教程 在上一篇:Linux Shell系列教程之(七)Shell输出这篇文章中,已经对She ...
- 你以为Shell只是命令行?读懂这篇文,给你的工作赋能
Shell 是什么呢?很多人以为的Shell就是命令行,一条条可以百度出来的命令行.而简历上你只会写熟悉Linux?今天用摩拜App给大家讲解下如何使用 Shell 去操作 Android 设备进行自 ...
- Shell | 实用命令不完全总结
本文不完全总结实用的 shell 命令 1. Updated: 2022 / 11 / 17 Shell | 实用命令不完全总结 uname 概念 用法 示例 ios Ubuntu dmesg 概念 ...
- shell awk命令详解
shell awk命令详解 awk原理 格式 实操 相关内建变量 简易需求 进阶操作 高阶操作 awk原理 逐行读取文本,默认时以空格或tab键为分隔符进行分隔,将分隔所得的各个字段保存到内建变量中, ...
- linux shell tr命令,linux shell tr命令详解
tr命令是linux下的一个命令,那么它的语法和用途是什么呢?下面由学习啦小编为大家整理了linux shell tr命令的相关知识,希望大家喜欢! linux shell tr命令 tr是trans ...
- linux基础(四):shell简单命令;文件系统命令,系统操作命令,文本操作命令;文本处理命令
目录 一.shell简单命令 1.1命令入门 1.1.1命令提示符详解 1.1.2命令格式 1.2 获取命令的帮助 1.2.1 help 1.2.2 命令 --help 1.2.3 查手册&搜 ...
- Shell常用命令 和 bat常用命令
linux和windows下的反斜杠\和正斜杠/区别 Windows:--"/"是表示参数,"\"是表示本地路径. xcopy /E /Y D:\DailyBu ...
最新文章
- C#——语言基础 之 运算符!
- 大型计算机主机通常采用,全国计算机一级选择题真题集
- MySQL查询的进阶操作--分组查询
- linux awk 教程,Linux awk使用案例教程
- 处理器排行_垃圾处理器排行榜 适邦垃圾处理器榜上有名
- 学习PL/SQL最好的书籍推荐
- 北斗轨迹记录_跑步GPS轨迹经常“飘”?要是用咱们的北斗,会好吗...
- 95-136-043-源码-Operator-LegacyKeyedCoProcessOperator
- c语言硬件信息监控,zabbix通过ipmi传感器监控浪潮服务器的硬件信息
- php工程师用的到高等数学吗,学习Python解决高等数学问题
- Innosetup打包自动下载.net framework 动态库及替换卸载程序图标.
- python 利用 Turtle库 画太阳花图形
- 高效技巧篇:化繁为简、高效使用金蝶K3WISE(金蝶K3WISE-主控台编辑)
- 【python】if __name__==‘__mian__‘ 如何理解,原理及作用
- 导弹拦截(动态规划)
- python使用docx模块读写docx文件的方法与docx模块常用方法详解
- 树莓派4B中中文字体和中文输入法设置不成功问题解决办法
- 题目-火影-鸣人-查克拉分配给分身(详解)
- 入侵检测技术综述(比较全)
- 2017新浪微整形年度大数据报告
热门文章
- mahout kmeans
- log4j2配置实例[按小时记录日志文件]
- 使用Spring的@Autowired 实现DAO, Service, Controller三层的注入(转)
- 博弈最高位POJ 1704(Georgia and Bob-Nim博弈)
- ADO.NET与ORM的比较(5):MyBatis实现CRUD
- 【JQUBAR1.1】jQuery 插件发布
- crontab 最小间隔_今天我间隔了:如何找到不在数组中的最小数字
- linux用户在哪个文件夹,LINUX中用命令成功建立一个用户后信息会记录在哪个文件中...
- priority_queue 结构体的优先级设置
- 什么样的人合适学习Python?