In short, I’m writing a script that will check if a computer is a MacBook Pro or a MacBook Air and then I want to use the output as a variable.
system_profiler SPHardwareDataType | grep “Model Name”
I can get Model Name: MacBook Pro but all I need is either “MacBook Pro” or “MacBook Air”
grep gives me an error. Another idea was to use find but I’m unsure how I’d use find if I’m not searching an actual file.