solution to bash error (because of the PATH)

本文解决了一个因修改/etc/bash.bashrc文件导致的bash启动时出现的命令未找到及语法错误等问题。通过重新编辑配置文件并修正PATH环境变量的路径设置来解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于修改了/etc/bash.bashrc时,将PATH变量中路径设置错误(路径拼写错误,呵呵,低级错误),所以当再次打开bash时,出现

Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
bash: lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
bash: dircolors: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: uname: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: uname: command not found
bash: [: !=: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: too many arguments
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: =: unary operator expected
bash: [: too many arguments
bash: [: =: unary operator expected
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
bash: sed: command not found
xuqiang@ubuntu:~$

下面解决方案:

首先成为超级用户(ubuntu)

/usr/bin/sudo -i(必须是绝对路径)

/usr/bin/nano /etc/bash.bashrc

删除掉错误信息就可。

请帮我分析这段日志* 从应用市场下载指定应用并存放到PC本地-AG_download_app command: adb -s 4TFBB25412100180 shell "getprop ro.build.version.release" 序号: 8, 应用名称: 美颜相机, 包名: com.meitu.meiyancamera 操作失败,原因:Message: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details Stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details at UIA2Proxy.command (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:85:5) 操作失败,原因:Message: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details Stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details at UIA2Proxy.command (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:85:5) ABORT Message: An unknown server-side error occurred while processing the command. Original error: 'GET /window/current/size' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details Stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: 'GET /window/current/size' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details at UIA2Proxy.command (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\ lib\jsonwp-proxy\proxy.js:274:13) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:85:5) ========= 测试耗时 : 29.542 秒 =========
07-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值