array=('org.battery.plist' 'org.disk.plist' 'org.memory.plist');
echo "1) org.battery.plist"
echo "2) org.disk.plist"
echo "3) org.memory.plist"
echo "Enter selection(s) to load, separated by commas: "
read var
sudo launchctl load -w ${array[$var]}
我在正确的轨道上吗?我有点卡住了。有人可以帮忙吗?
如果用户输入 1、2,我希望脚本在下面执行此操作 -
sudo launchctl load -w org.disk.plist
sudo launchctl load -w org.memory.plist