I'm parsing a simple conf file of the following format:key = valueTo do this, I use awk likeKEY=$(awk -F' *= *' '/^key/{print $2}' file.conf)However, some values might containt = symbol, so what I want is basically to tell awk that I need only two columns, i.e. force it to accept everything it encounters after the first separator as one column. I didn't find such option. How can I do that? 
awk: set desired number of columns?
awk
If the separator can appear inside fields, then it's not really a separator. I'd use something likeKEY=$(sed -n '/^key *=/ { s/^key *= *//; p }' file.conf)instead: this looks for lines starting with key followed by any number of spaces and an = sign, drops the start of the line and prints it. As dave_thompson_085 points out the p can be conditioned on the s:KEY=$(sed -n 's/^key *= *//p' file.conf)The equivalent AWK isKEY=$(awk '/^key *=/ { sub(^key *= *, ); print }' file.conf)and the same combining trick can be used:KEY=$(awk 'sub(^key *= *, )' file.conf)