我正在尝试在 Ubuntu 14.04 上安装Virtualenv包装器。但是每当我启动终端时,我都会收到错误提示 bash:
/usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh:没有这样的文件或目录。
我还通过使用检查了 bashrc 脚本gedit ~/.bashrc,但没有这样的行。有谁知道我错在哪里?
在 bash 中,我可以使用该help命令打印特定内置命令的概要
$ help pwd
pwd: pwd [-LP]
Print the name of the current working directory.
Options:
-L print the value of $PWD if it names the current working
directory
-P print the physical directory, without any symbolic links
By default, `pwd' behaves as if `-L' were specified.
Exit Status:
Returns 0 unless an invalid option is given or the current directory
cannot be read.
Run Code Online (Sandbox Code Playgroud)
zsh 中是否有等效项,或者我只是使用man zshbuiltins?
我想将文件夹 A 的所有二进制文件软链接到文件夹 B,例如,
find /home/A/bin/* -print | xargs -I {} ln -sf {} /tmp/B/$(basename {})
Run Code Online (Sandbox Code Playgroud)
问题是我无法在 xargs 中执行子命令。
我该怎么办 ?
我遇到了 Outlook 2003 的规则大小限制,所以我想合并/删除我的规则。我希望能够看到所有这些,而不是一次编辑一个。Outlook 规则的导出格式是一些二进制“*.rwz”文件。
有没有办法将 Outlook 规则导出到文本或 Excel 文件中?
我正在使用以下脚本递归搜索从其他文件调用的 php 脚本的出现。
find . -exec grep -Hn $1 {} \; | grep -v ^Binary;
Run Code Online (Sandbox Code Playgroud)
效果很好!现在,我需要返回的结果来确定下一步要采取的行动。
r=$(find . -exec grep -Hn $str {} \; | grep -v ^Binary;)
if [ -z "$r" ];
then
Do this
else
Do something else
fi
Run Code Online (Sandbox Code Playgroud)
问题: find 脚本通过它自己返回结果,每个结果都在一个新行上。
./path/to/file.php
./path/to/another_file.php
./path/to/third_file.php
Run Code Online (Sandbox Code Playgroud)
但是,将输出分配给 $r 变量时,不会保留换行符,结果打印在一行上,因此难以阅读。
./path/to/file.php ./path/to/file.php ./path/to/third_file.php
Run Code Online (Sandbox Code Playgroud)
如何在将输出分配给变量时保留换行符?
我在后台同时运行多个任务。
command_a | tee > command_a.log &
command_b | tee > command_b.log &
Run Code Online (Sandbox Code Playgroud)
如果一切正常,则消息将保存到日志文件中。
如果出现问题,它会在屏幕上打印错误。
但是command_a 和command_b 非常相似,很难分辨哪个错误信息是由哪个命令产生的。
我可以在错误消息中添加前缀字符串,例如:
command_a: error 123
command_b: error 456
command_a: error 256
command_a: error 555
command_b: error 333
Run Code Online (Sandbox Code Playgroud)