分页: 1 / 1

[问题]阻止软件包升级命令不理解之处,请教(已解决)

发表于 : 2006-11-11 12:53
oliver
该命令:
dpkg --get-selections \* > selections.txt
中"\*"的组合是什么意思呢?

这位仁兄(http://www.linuxsir.org/bbs/showpost.ph ... ostcount=3)告诉我
"\"在这里是转义字符,"*"就是星号而非通配符代表任意全部,可是我还是感觉"*"在这里是通配符。

发表于 : 2006-11-11 19:34
BigSnake.NET
* = 任何字符
/* = 星號

发表于 : 2006-11-12 12:08
oliver
BigSnake.NET 写了:* = 任何字符
/* = 星號
直接 dpkg --get-selections > (某个文件) 不是就可以将包选项目录标准输出重定向到某个文件了么? 加上星号有什么意义呢?不解...

发表于 : 2006-11-12 14:34
aBiNg
$man dpkg
...
dpkg --get-selections [package-name-pattern...]
Get list of package selections, and write it to stdout. Without a pattern, packages marked with state purge will not be shown.
...

here \*=="*", which is the pattern mode to match all of the debian packages without considering the state.

发表于 : 2006-11-12 16:45
oliver
谢谢四楼的兄弟,现在明白了 :)
"\*"就是"*" ,也就是*通配符
如果没有“\”,那么"*"就会当成"*"符号。
例如

代码: 全选

oliver@ubuntu:~$ dpkg --get-selections acpi  >  Desktop/temp3.txt    
acpi就是一个符合模式,标准输出就只有acpi这一个包。
而用"\*"就代表"*"通配符代表所有。
如果没有任何模式字符,那么被标记为删除状态的包就不会在标准输出中出现。

P.S.你的注释是你自己用英语组织语言的吧?我dpkg manual中没有
Without
a pattern, packages marked with state purge will not be shown.

这一段。
:)