如何在Android中包含envsetup.sh的命令?

发布于 2024-11-01 02:49:57 字数 875 浏览 1 评论 0原文

你好 我在编译时在 android 源代码上运行了命令 ./build/envsetup.sh 。 我想使用同一文件中存在的以下命令。 -cgrep -嗯 -mm

但是我收到以下错误!!

 Command 'pgrep' from package 'procps' (main)
 Command 'fgrep' from package 'grep' (main)
 Command 'egrep' from package 'grep' (main)
 Command 'sgrep' from package 'sgrep' (universe)
 Command 'grep' from package 'grep' (main)
 Command 'lgrep' from package 'lv' (universe)
 Command 'rgrep' from package 'grep' (main)
 Command 'zgrep' from package 'gzip' (main)
 Command 'dgrep' from package 'debian-goodies' (main)
 Command 'vgrep' from package 'atfs' (universe)
 Command 'ngrep' from package 'ngrep' (universe)
 Command 'wcgrep' from package 'kdesdk-scripts' (main)
 Command 'agrep' from package 'agrep' (multiverse)
 Command 'xgrep' from package 'xgrep' (universe)
 cgrep: command not found

我应该如何解决这个问题? 我需要对 envsetup.sh 文件进行任何更改吗?

Hi
I have run the command ./build/envsetup.sh on my source code of android while compiling.
I want to use the following commands present in the same file.
-cgrep
-mmm
-mm

but I get the following errors!!

 Command 'pgrep' from package 'procps' (main)
 Command 'fgrep' from package 'grep' (main)
 Command 'egrep' from package 'grep' (main)
 Command 'sgrep' from package 'sgrep' (universe)
 Command 'grep' from package 'grep' (main)
 Command 'lgrep' from package 'lv' (universe)
 Command 'rgrep' from package 'grep' (main)
 Command 'zgrep' from package 'gzip' (main)
 Command 'dgrep' from package 'debian-goodies' (main)
 Command 'vgrep' from package 'atfs' (universe)
 Command 'ngrep' from package 'ngrep' (universe)
 Command 'wcgrep' from package 'kdesdk-scripts' (main)
 Command 'agrep' from package 'agrep' (multiverse)
 Command 'xgrep' from package 'xgrep' (universe)
 cgrep: command not found

How should I resolve this?
Do I need to make any changes in the envsetup.sh file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘虞初梦 2024-11-08 02:49:57

mm、mmm 和 cgrep 被定义为 shell 函数。以下内容会给您带来什么回报:

set | egrep "^mmm \(\)|^mm \(\)|^cgrep \(\)"

在我的环境中,我得到:

cgrep ()
mm ()
mmm ()

如果您没有得到任何回报,则您可能采购了错误的脚本。请记住,您不能只是使脚本可执行并运行它,因为它不会将函数导出回您的 shell。您必须使用:

. build/envsetup.sh

OR

source build/envsetup.sh

确保它在父 shell 中运行。

The mm, mmm and cgrep are defined as shell functions. What does the following return for you:

set | egrep "^mmm \(\)|^mm \(\)|^cgrep \(\)"

On my environment I get:

cgrep ()
mm ()
mmm ()

If you are getting nothing back, you are probably sourcing the script wrong. Remember you can't just make the script executable and run it as it won't be exporting the functions back to your shell. You must use either:

. build/envsetup.sh

OR

source build/envsetup.sh

to ensure it runs in parent shell.

坏尐絯 2024-11-08 02:49:57

您需要在 AOPS 根目录中使用此命令返回您的 android 根内容:

source ./build/envsetup.sh

You need to return your android root content with this command in the AOPS root directory:

source ./build/envsetup.sh
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文