Не самый эффективный способ. Но с OP все в порядке с awk
awk -F'[' '{gsub(/\]/ , "", $2); gsub(/\]/ ,"" ,$3); $3="\042"$3"\042"; print}' ;
Демо:
$echo "select [Project_ID] AS [Project ID]" | awk -F'[' '{gsub(/\]/ , "", $2); gsub(/\]/ ,"" ,$3); $3="\042"$3"\042"; print}' ;
select Project_ID AS "Project ID"
$
Объяснение:
awk -F'[' -- Set delimiter as "["
gsub(/\]/ , "", $2); -- Replace ] with "" in second field. We pass regular expression between / / and \ - is escape character
gsub(/\]/ ,"" ,$3) -- Remove ] from third field.
$3="\042"$3"\042" -- Concat double quotes at start and end of 3rd field.