下面是一些来自Docker容器(运行Ubuntu18.04)的输出,它似乎出了问题。
# source ~/.profile
net.ipv4.ipfrag_high_thresh = 134217728
net.core.rmem_default = 10485760
sourcing /opt/ros/foxy/install/setup.bash
ROS_ROOT /opt/ros/foxy
ROS_DISTRO foxy
# bash -c "source ~/.profile"
# /bin/bash -c "source /root/.profile"
# 第一个命令的输出是我期望从以下命令得到的结果。感觉好像我漏掉了一些显而易见的东西。对于上下文,我需要/bin/bash -c "source /root/.profile"来工作,因为我不想为了运行命令而进入Docker容器,而且我希望在运行这些命令之前在.bashrc中运行这些东西。我哪里出问题了?
发布于 2021-10-05 08:45:21
在.bashrc中:
# If not running interactively, don't do anything
[ -z "$PS1" ] && return以下命令工作正常:
/bin/bash -ic "source ~/.bashrc"https://askubuntu.com/questions/1367500
复制相似问题