How to use awk separator of single quote?
Solution 1:
To insert a single quote character in a single-quoted string, end the current string, write "'"
or \'
and begin the string again.
In your example, that's
awk 'BEGIN{FS="'"'"'"}{print $2}'
or
awk 'BEGIN{FS="'\''"}{print $2}'
However, using the -F
switch to specify the field separator will result in more legible code:
awk -F\' '{print $2}'