I have a line like this:
uid=2560(jdihenia) gid=1000(undergrad)
I want to just get the part undergradfor var1 variable. Therefore, I used the command
var1=`echo "uid=2560(jdihenia) gid=1000(undergrad)" | cut -d "(" -f 3`
but it will assign the value undergrad)in to in var1. Could you tell me how can I get only the part undergradin var1 variable?
source
share