对于bash在线评论? [英] Inline comments for bash?

查看:88
本文介绍了对于bash在线评论?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能在一个单行命令注释掉一个标志。只有猛砸似乎已经从`#到尾线的意见。我看着像招数:

 的ls -l $([]&功放;&放大器; -F关闭)-a /等

这是难看,但聊胜于无。任何人有什么更好的建议?

更新

下面似乎工作,但我不知道是否它是便携式:

 的ls -l`#-F打开off` -a /等


解决方案

我觉得最简单的(和最可读)把刚才复制的行并注释掉原始版本:

  #Old LS版本:
#ls -l $([]&功放;&放大器; -F关闭)-a /等
ls -l命令-a /等

I'd like to be able to comment out a single flag in a one-line command. Bash only seems to have `from # till end-of-line' comments. I'm looking at tricks like:

ls -l $([ ] && -F is turned off) -a /etc

It's ugly, but better than nothing. Anybody has any better suggestions?

UPDATE

The following seems to work, but I'm not sure whether it is portable:

ls -l `# -F is turned off` -a /etc

解决方案

I find it easiest (and most readable) to just copy the line and comment out the original version:

#Old version of ls:
#ls -l $([ ] && -F is turned off) -a /etc
ls -l -a /etc

这篇关于对于bash在线评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆