I have this command line that I enter into terminal and it works as intended:
dscl . -readall /Users UniqueID | awk '/^RecordName:/ {name=$2}; /^UniqueID: / {if ($2 > 500) print name}'
What I want to do is use sh -c "insert command string here" and when I try and use the above statement, it gives me these errors:
awk: syntax error at source line 1
context is
/^RecordName:/ >>> {name=} <<<
awk: illegal statement at source line 1
awk: illegal statement at source line 1
Any idea how I would correct this? I need it for a program in objective-c.