Possible Duplicate:
07000
我想做这样的事情
sudo apt-get install \ #a very long description #of the package #that spans multiple lines pkg1 \ #maybe I want an inline comment also #another description that #spans multiple lines pkg2
注意,我不只是对apt-get命令感兴趣。
据我所知,Bash在单个命令中忽略“#”之后的所有内容,并且多行不会改变。但是,您可以使用bash数组来实现相同级别的表达式:
原文链接:https://www.f2er.com/bash/388448.htmlpackagelist=( package1 # Inline Comments # Multiline Comments too package2 # Package description goes here # Detailed descriptions.. ) sudo apt-get install ${packagelist[@]}