to change only the second match word ( to replace Allow,Deny with Deny,Allow )
sed solução:
Amostra tmp_file
:
Allow,Deny
Allow,Deny
Allow,Deny
Allow,Deny
sed ':a;N;$!ba; s/Allow,Deny/Deny,Allow/2' tmp_file
A saída:
Allow,Deny
Deny,Allow
Allow,Deny
Allow,Deny