我有一个位于 /private/var/db/dslocal/nodes/default/users 下的 plist 文件。我能够使用 plutil 读取 plist 中的值。
plutil -p /private/var/db/dslocal/nodes/default/users/swastibhushandeb.plist
输出摘录:
{
"hint" => [
0 => "abcxyz"
]
"home" => [
0 => "/Users/swastibhushandeb"
"name" => [
0 => "swastibhushandeb"
1 => "[email protected]"
]
"passwd" => [
0 => "********"
]
"picture" => [
0 => "/Library/User Pictures/Animals/Parrot.tif"
]
"realname" => [
0 => "Swasti Bhushan Deb"
]
"record_daemon_version" => [
0 => "48400XX"
]
"uid" => [
0 => "501"
}
使用 bash 从 plist 中选择特定值(例如“name”、“realname”等)的最佳方法是什么。