我在本指南的帮助下设置了我的 ssh 东西,它曾经运行良好(我可以在hg push没有被要求输入密码的情况下运行)。考虑到我仍在使用相同的主目录,从那时到现在可能会发生什么。
$ cat .hg/hgrc
[paths]
default = ssh://hg@bitbucket.org/tshepang/bloog
$ hg push
Enter passphrase for key '/home/wena/.ssh/id_rsa':
pushing to ssh://hg@bitbucket.org/tshepang/bloog
searching for changes
...
Run Code Online (Sandbox Code Playgroud) 我有一个将纪元时间转换为日期的函数。这是定义
date1(){
date -d @$1
}
Run Code Online (Sandbox Code Playgroud)
我希望能够写:
$ date1 xxxyyy
Run Code Online (Sandbox Code Playgroud)
其中 xxxyyy 是我传递给函数的参数,因此我可以获得相应的日期。我明白我必须将它添加在任.bash_profile,.profile或.bashrc然后它来源:
$ source file
Run Code Online (Sandbox Code Playgroud)
但是,我不确定应该把它放在哪个文件中。目前,我把它放在.profile. 但是要运行它,我必须source .profile每次都这样做。
理想情况下,当计算机像环境变量一样启动时,它应该使其可用。