2012-07-05 3 views
0

Mac에서 scutil을 사용하여 dict을 작성하여 데이터 저장소에 저장하는 방법을 알고 있습니다.Mac에서 scutil을 사용하여 데이터 저장소에 배열을 넣을 수 있습니까?

$ scutil 
> show Kerberos-Default-Realms 
<array> { 
    0 : ATHENA.MIT.EDU 
} 

어떻게 수동으로 같은 항목을 만들 수 있습니다

는하지만, 내 시스템은 값이 단지 배열 키를 보여줍니다? 내 자동 테스트에서이 작업을 수행해야합니다.

내가 대답 (개정) 발견 할 수 있습니다
+0

당신이 "쇼"를 해줘서 고맙지 만, 정말로보고 싶은 것은 사전을 만드는 방법입니다. –

+0

그게 내가 원하는거야. 해당 엔트리는 시스템에 의해 생성됩니다. 이것은 OS X 서버입니다. – speedogoo

답변

1

:

$ scutil 
> help 

Available commands: 

help       : list available commands 
f.read file     : process commands from file 
quit       : quit 

d.init      : initialize (empty) dictionary 
d.show      : show dictionary contents 

d.add key [*#?] val [v2 ...] : add information to dictionary 
     (*=array, #=number, ?=boolean) 
d.remove key     : remove key from dictionary 

list [pattern]    : list keys in data store 
add key ["temporary"]   : add key in data store w/current dict 
get key      : get dict from data store w/key 
set key      : set key in data store w/current dict 
show key ["pattern"]   : show values in data store w/key 
remove key     : remove key from data store 
notify key     : notify key in data store 

n.list ["pattern"]   : list notification keys 
n.add key ["pattern"]   : add notification key 
n.remove key ["pattern"]  : remove notification key 
n.changes      : list changed keys 
n.watch      : watch for changes 
n.cancel      : cancel notification requests 

위의 문제의 예를 다시 만들려면 :

> d.init 
> d.add Kerberos-Default-Realms * ATHENA.MIT.EDU 
> d.show 
<dictionary> { 
    Kerberos-Default-Realms : <array> { 
    0 : ATHENA.MIT.EDU 
    } 
} 

... 그리고 쓰레기,하지 않습니다 정확히 너 지금 필요해, 그렇지? 내 말은, 올바른 값을 가진 배열을 가지고 있지만 해당 배열이 사전에 있음을 의미합니다. 당신의 조정에 더 뭔가를 찾고 있었다

:

> d.show 
<array> { 
    0 : ATHENA.MIT.EDU 
} 

그래서 우리가 더 많은 같은 것을 필요 의미

> a.init 
a.init: unknown, type "help" for command info 

그림을 ... 잠깐! 만약에 I :

> get Kerberos-Default-Realms 
> d.show 
<array> { 
    0 : ATHENA.MIT.EDU 
} 

달콤한, 지금 내 "현재 사전은"배열, 그래서 여기에서 무언가 일을 할 수 있어야한다 : 아니 ... 그건 내 마지막

> d.add Kerberos-Default-Realms ATHENA.MIT.EDU ZEUS.MIT.EDU 
d.add: data (fetched from configuration server) is not a dictionary. 

했다 희망 ... NSArray가 유효한 NSObject라는 것을 알고 있지만, scutil이 NSMutableArray를 추가하거나 수정하도록 지원하지 않는다고 생각합니다.

:

는 분명히 (Kerberos를 기본-막대한 보수가 배열되어 있기 때문) 동적 저장소에 그것을 얻을 수있는 몇 가지 방법이 있지만, scutil 나에게 막 다른 골목처럼 보이는 ... 오직 한 가지 할 왼쪽

> quit 
관련 문제