Hello,
I'm trying to use awk to parse the uid=xxx information that is displayed when I run the command id $user. Right now my code looks like
Which prints out:
uid=500(jsmith)
My question is how do I get awk to just print out the uid=xxx portion of the 'id $USER' command. In other words to leave off the jsmith portion. Any help is greatly
appreciated.
I'm trying to use awk to parse the uid=xxx information that is displayed when I run the command id $user. Right now my code looks like
Code:
#!/bin/bash
id $USER | awk '/uid=[0-9]*/ {print $1}'
Which prints out:
uid=500(jsmith)
My question is how do I get awk to just print out the uid=xxx portion of the 'id $USER' command. In other words to leave off the jsmith portion. Any help is greatly
appreciated.