使用时git add .使用您所在的实际路径(incase 是一个 git repo)。我将如何使用git add,git commit和git push' outside of the working dir? Likegit add /Users/zad0xsis/my-git-repo`。
这能实现吗?
我有一个 bash 脚本,可以在其中获取磁盘使用情况,例如60%. 如何删除%符号?使用 grep 还是 awk?
我正在制作一个 bash 脚本来检查磁盘上的可用空间:
if [ check_space -gt "85" ]; then
echo "removing"
else
echo "not removing"
fi
Run Code Online (Sandbox Code Playgroud)
check_space返回一个数字52,check_space函数是:
check_space() {
df /dev/sda1 | tail -1 | awk '{print $5}' | sed 's/%//';
}
Run Code Online (Sandbox Code Playgroud)
它正在返回./backup.sh: line 63: [: check_space: a full expression was expected(我从西班牙语翻译它,所以可能不是准确的翻译)。可能有什么问题?