This is a weird problem. Following is my code.
/opt/quest/bin/vastool configure pam sshd
/opt/quest/bin/vastool configure pam ssh
cat /etc/pam.conf | \
awk '$1=="ssh"||$1=="sshd"||$1=="emagent"{sub("prohibit","aix",$NF);}1' OFS='\t' > /etc/pam.conf
cat /etc/ssh/sshd_config | \
sed -e 's/^UsePAM no/UsePAM yes/' > /etc/ssh/sshd_config
If I remove below from the script, both awk and sed are working accordingly.
/opt/quest/bin/vastool configure pam sshd
/opt/quest/bin/vastool configure pam ssh
But if I execute them together, those files, which are supposed to change are becoming empty
Is there any relation between pam ssh configuration and sed/awk? I totally not getting the point behind that.