我正在编写一个基本的BASH脚本,但我遇到了一些麻烦。
运行
defaults read org.eyebeam.SelfControl
终端中的返回与SelfControl关联的所有默认值:
{
BlockDuration = 6;
BlockLengthInterval = 15;
BlockSoundShouldPlay = 1;
BlockStartedDate = "4001-01-01 00:00:00 +0000";
GetStartedShown = 1;
HostBlacklist = (
"*:80",
"*:443"
);
"MASPreferences Selected Identifier View" = GeneralPreferences;
MaxBlockLength = 7200;
SUHasLaunchedBefore = 1;
SULastCheckTime = "2017-05-07 05:09:59 +0000";
VerifyInternetConnection = 0;
WhitelistAlertSuppress = 1;
}
然而,在bash脚本中运行相同的完整代码行只返回一件事 - BlockDuration,我使用
编辑 defaults write org.eyebeam.SelfControl BlockDuration -int 6
。具体来说,我不想编辑BlockStartedDate
,但我想提取它的价值。有没有人知道为什么我可以在终端,但不是在我的脚本?