我有一个 .bashrc 文件,我想设置它以便它从 .aliases 文件读取别名并设置它们。
目前我有:
# User specific aliases and functions
while read alias_line
do
echo `alias ${alias_line}`
done < .aliases
Run Code Online (Sandbox Code Playgroud)
但是登录后我得到:
-bash:别名:-fu:未找到 -bash:别名:$USER”:未找到
-bash:别名:-lart”:未找到
.aliases 文件是这样的:
psu="ps -fu $USER" ll="ls -lart"
pico='nano'
可能重复:
Grep 命令,删除包含指定单词的行
如何在一个 grep 命令中对多个单词进行 grep。例如:
cat file.txt | grep -v 'word1' | grep -v 'word2'
Run Code Online (Sandbox Code Playgroud)
被转换成类似的东西:
cat file.txt | grep -v 'word1|word2'
Run Code Online (Sandbox Code Playgroud) 我无法将路径作为内部有空格的参数传递。
keyLocation="/Users/vladimir/Google\ Drive/file.pem"
ssh -i $keyLocation root@192.168.1.1;
Run Code Online (Sandbox Code Playgroud)
这给了我以下错误:
警告:无法访问身份文件 /Users/vladimir/Google:没有此类文件或目录。
基本上在分配 keyLocation 本身变成 "/Users/vladimir/Google Drive/file.pem" (no ) 之后,当它尝试使用 $keyLocation 作为参数时,它会将其作为
ssh -i /Users/vladimir/Google Drive/file.pem root@192.168.1.1
Run Code Online (Sandbox Code Playgroud)
如何让 ssh 命令将其识别为内部有空格的路径?