博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bash path_如何在Linux上的Bash中获取另一个用户的PATH?
阅读量:2519 次
发布时间:2019-05-11

本文共 550 字,大约阅读时间需要 1 分钟。

bash path

How to get the $PATH environment variables of another user in Bash on ? The current user running the Bash is root.

如何在 Bash中获取另一个用户的$PATH环境变量? 当前运行Bash 用户是root

If the scripts is run by root, this piece of code will store the PATH from the environment of the user user1:

如果脚本是由root用户运行的,则这段代码将存储用户user1的环境中的PATH:

user1path=$(su - $user1 -c env | grep ^PATH= | cut -d'=' -f2-)

It runs command as the $user to out its environment and find out the $PATH.

它以$user身份运行命令,以出其环境并找出$PATH

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自:

bash path

转载地址:http://kqlwd.baihongyu.com/

你可能感兴趣的文章
android 构建数据库SQLite
查看>>
部署多个tomcat
查看>>
生成器/内置函数
查看>>
Windows Phone 8: NavigationInTransition实现页面切换效果
查看>>
新概念英语(1-53)An interesting climate
查看>>
installing the numpy via pip in the enviroment dos
查看>>
ASP.NET MVC中如何在当前页面上弹出另外一个页面
查看>>
VS2015 MSVC编译FFMPEG
查看>>
红外图像盲元补偿matlab实现源码与效果验证
查看>>
Linux环境下部署SpringBoot项目
查看>>
C# 通过反射来动态创建泛型类型
查看>>
git bash中不能显示中文
查看>>
常用算法
查看>>
SQL算术数字的默认类型
查看>>
正则表达式
查看>>
TCP/IP Socket
查看>>
How do I debug a published XBAP file in VS2010?
查看>>
单工、半双工和全双工的定义
查看>>
Hdu【线段树】基础题.cpp
查看>>
时钟系统
查看>>