停止外壳通配符扩展? [英] Stop shell wildcard character expansion?

查看:117
本文介绍了停止外壳通配符扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法对编译命令行程序告诉bash或csh的,它不希望在其参数的任何通配符扩展?

Is there any way for a compiled command-line program to tell bash or csh that it does not want any wildcard characters in its parameters expanded?

例如,我们可能需要一个shell命令,如:

For instance, one might want a shell command like:

富*

简单地返回字符的数字ASCII值。

to simply return the numeric ASCII value of that character.

推荐答案

没有。膨胀发生时,该命令实际运行前。结果
您只能在运行命令之前或引述明星禁用水珠。

No. The expansion takes place, before the command is actually run.
You can only disable the glob before running the command or by quoting the star.

$ # quote it
$ foo '*'

$ # or escape it
$ foo \*

$ # or disable the glob (noglob)
$ set -f
$ foo *

这篇关于停止外壳通配符扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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