我有一个 perforce 版本控制客户端 ( p4)的可执行文件。我不能把它放进去,/opt/local因为我没有 root 权限。是否有一个标准位置需要放置在它下面$HOME?
文件系统层次结构是否有一个约定,说明需要将本地可执行文件/二进制文件放入$HOME/bin?
另外,如果确实有约定,我是否必须明确包含$HOME/bin目录的路径或目录的任何位置bin?
fhs executable software-installation directory-structure not-root-user
如何传递包含点 (.) 的命令行参数?是否有任何转义序列用于捕获像点这样的字符?
以下从 shell 调用 bash 脚本不起作用:
# ./deploy.sh input.txt
./deploy.sh: line 9: input.txt: syntax error in expression (error token is ".txt")
Run Code Online (Sandbox Code Playgroud)
我尝试了以下方法:
编辑
以这个用例为例:
解决方案:
这是执行 1(将工件读入数组)的简单脚本:
#!/bin/bash
declare -a artifacts
for i
do
artifacts[i]=$i
echo ${artifacts[i]}
done
Run Code Online (Sandbox Code Playgroud)
执行1
-bash-3.00$ ./simple.sh arg1 arg2 arg3
arg1
arg2
arg3
Run Code Online (Sandbox Code Playgroud)
执行2
-bash-3.00$ ./simple.sh arg1.txt arg2.txt arg3.txt
./simple.sh: line …Run Code Online (Sandbox Code Playgroud) -bash-3.00$ ./p4 -V
-bash: ./p4: Invalid argument
Run Code Online (Sandbox Code Playgroud)
Unix 中的“无效参数”是什么意思?
更多细节: