sed를 이용한 파일 수정 자동화
echo $TMOUT; if [ "x$TMOUT" != "x300" ]; then cp /etc/profile /etc/profile.20130627; sed s/^.*TMOUT=600$/TMOUT=300/ /etc/profile.20130627 > /etc/profile; diff /etc/profile /etc/profile.20130627; else echo OK; fi;
cp /etc/inetd.conf /etc/inetd.conf.20130628; sed -e 's_^ntalk dgram udp wait root /usr/sbin/talkd talkd_#ntalk dgram udp wait root /usr/sbin/talkd talkd_' -e 's_^daytime.*stream.*_#daytime stream tcp nowait root internal_' -e 's_^time.*stream.*_#time stream tcp nowait root internal_' -e 's_^daytime.*dgram.*_#daytime dgram udp wait root internal_' -e 's_^time.*dgram.*_#time dgram udp wait root internal_' -e 's_^dtspcd.*_#dtspcd stream tcp nowait root /usr/dt/bin/dtspcd /usr/dt/bin/dtspcd_' /etc/inetd.conf.20130628 > /etc/inetd.conf; diff /etc/inetd.conf /etc/inetd.conf.20130628; refresh -s inetd; egrep 'talk|time|dtspcd' /etc/inetd.conf
'Unix/Linux' 카테고리의 다른 글
(NFS) How to force mountd/lockd to use a specific port. (0) | 2013.07.05 |
---|---|
Sed - An Introduction and Tutorial by Bruce Barnett (0) | 2013.06.28 |
mintty bright blue (0) | 2013.05.03 |
How to clear bash history compeletly? (0) | 2013.05.01 |
What command to show Centos version running (0) | 2013.04.17 |