给 alias 添加命令行参数

定义 alias 时,有用命令行参数的需求。但通过查证文档的结果是,alias 根本就不支持传递命令行参数。不过,我们可以变通的解决这个问题,即定义函数。

alias test='test() { echo $1; };test'

[hadoop@NN069186 dev]$ source ~/.bashrc 
[hadoop@NN069186 dev]$ test abc def gh
abc def
[hadoop@NN069186 dev]$

发表评论

电子邮件地址不会被公开。

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.