Questions tagged «.bash-profile»

.bash_profile是Bash shell作为交互式登录shell启动时读取并执行的脚本之一。

6
在计算机之间同步bash配置文件
我的.bash_profile中有很多东西。问题是,我经常使用约3台计算机,而我厌倦了不得不到处复制粘贴我的偏好设置。其中两个运行Ubuntu 10.10,一个运行OSX。我想知道是否有一种使用Dropbox共享单个prefs文件的方法。例如,当bash开始时,告诉它检查~/Dropbox/Bash/.bash_profile? 虽然,我还能告诉emacs以~/Dropbox/Emacs/.emacs某种方式看吗?

2
解释为什么.bash_logout无法运行命令?
所以我一直想知道每次关闭Terminal的打开实例时如何运行这两行代码: history -c cat /dev/null > ~/.bash_history 我export HISTFILE=5在启动时,但仍然想在完成后将其冲洗掉。 我已经尝试在几个地方环顾四周,运气并不好。 我运行Linux Mint,并且在此还要注意,我遇到了类似的问题.bash_profile;最终,我发现我需要将所有启动代码都放在中.bashrc,因此可能与它有关。这是我的.bash_logout文件: #!/bin/bash # ~/.bash_logout: executed by bash(1) when login shell exits. #this does nothing on exit... echo 'logout'; sleep 2s # when leaving the console clear the screen to increase privacy if [ "$SHLVL" = 1 ]; then history …


4
我打破了我的.bash_profile
在尝试在我的Mac OSX机器上安装某些东西的过程中,我想我已经破坏了我的〜/ .bash_profile文件。我编辑了它,突然,现在,当我打开终端时,我无法运行任何内容,甚至列出文件: $ ls -bash: ls: command not found 不好了!我尝试打开emacs来编辑〜/ .bash_profile,但我不能: $ emacs ~/.bash_profile -bash: emacs: command not found $ port install emacs MacPorts running without privileges. You may be unable to complete certain actions (eg install). ---> Computing dependencies for emacs MacPorts running without privileges. You may be …

3
OS X Lion - 安装Oracle 10g标准版
我正在尝试将Oracle 10g安装到OS X Lion上。我之前在Snow Leopard上实现了以下功能 教程 。 我遇到的问题是。中的ulimit设置 oracle/.bash_profile 无法修改。 我在bash_profile中有以下内容: export DISPLAY=:0.0 export ORACLE_BASE=$HOME umask 022 # must match `sysctl kern.maxprocperuid` ulimit -Hu 512 ulimit -Su 512 # must match `sysctl kern.maxfilesperproc` ulimit -Hn 10240 ulimit -Sn 10240 应用bash_profile设置后 . ~/.bash_profile 我收到以下错误: -bash: ulimit: max user processes: cannot be …

3
Win10:VS代码集成bash没有加载〜/ .bash_profile
正如标题所示,当我经常启动我的git bash时会加载我的〜/ .bash_profile但是我的VS Code中集成的那个没有加载它。 我在哪里可以放入.bash_profile,以便它也可以在VS Code中加载? 编辑:这是我与终端的vs代码 这是我的git bash 我想在我的git bash上加载的vs代码终端中加载相同的.bash_profile文件,这样它就会显示分支名称并且还有我在那里定义的别名。

2
bash中命令的默认参数
设置一个新的开发虚拟机,我希望这样做,以便默认的MySQL用户始终是特定的用户,除非另有说明。 理想的命令: $ mysql # translates to mysql -uMyUser -pMyPass $ mysql -uMyOtherUser -pMyOtherPass # login behaves as expected 我只需要将它应用于一个特定的用户,所以这可能是 .bash_profile。如果它可以应用于所有用户,甚至更好。

1
.bashrc在没有我的批准的情况下运行别名:致命:不是git存储库(或任何父目录):。git
我在bash_profile中有这个,我把罪魁祸首缩小到: alias initialpush="git push -u origin `git symbolic-ref --short -q HEAD`" 我无法正确获取bash_profile: cchilders:~ $ src fatal: Not a git repository (or any of the parent directories): .git 改为其他风格没有帮助,同样的问题: alias initialpush="git push -u origin $(git symbolic-ref --short -q HEAD)" 我认为这只发生在Mac上,我不能确定,直到我回家检查。我的脚本是在Ubuntu上编写的。我不记得发生这种错误,直到我在工作中使用Mac。我怎么能阻止这个bash_profile疯狂?谢谢

1
为什么登录时主目录下的.profile不起作用
我是UNIX的新手。我使用的是mac OS X 10.8。我在主目录下创建了.profile。但是,它在登录时不起作用。我总是要使用命令强制它工作$ . ~/.profile。有谁可以帮我解释一下? 另一个问题,我尝试编写一个Cshell名称wld并使其可执行。但是,我不能仅仅通过输入来调用它$ wld。我要打字$./wld。如何让它正常工作?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.