如何在 bash 中更改 argv0 以便命令在 ps 中显示不同的名称? [英] How to change argv0 in bash so command shows up with different name in ps?

查看:23
本文介绍了如何在 bash 中更改 argv0 以便命令在 ps 中显示不同的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 C 程序中,我可以编写 argv[0] 并且新名称显示在 ps 列表中.

In a C program I can write argv[0] and the new name shows up in a ps listing.

如何在 bash 中执行此操作?

How can I do this in bash?

推荐答案

我有机会浏览了 bash 的源代码,但它似乎不支持写入 argv[0].

I've had a chance to go through the source for bash and it does not look like there is any support for writing to argv[0].

这篇关于如何在 bash 中更改 argv0 以便命令在 ps 中显示不同的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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