📄 tst-chage
字号:
#!/bin/bashexport LANG=CTEMPDIR=`mktemp -d tests.XXXXXX`touch $TEMPDIR/passwdtouch $TEMPDIR/shadow./useradd -G "" -P $TEMPDIR chagetest1 -c "Test account"./chage -P $TEMPDIR -m 7 -M 92 -d 2000-02-29 -E 2004-02-29 -I 7 -W 14 --service files chagetest1 > tst-chage.run 2>&1./chage -P $TEMPDIR -l chagetest1 > tst-chage.out1cat << EOT > tst-chage.expect1Minimum: 7Maximum: 92Warning: 14Inactive: 7Last Change: Feb 29, 2000Password Expires: May 31, 2000Password Inactive: Jun 07, 2000Account Expires: Feb 29, 2004EOTdiff -q -u tst-chage.expect1 tst-chage.out1./chage -P $TEMPDIR -m 7 -M 92 -d 2000-02-29 -E 2004-02-29 -I 0 -W 14 --service files chagetest1 > tst-chage.out 2>&1./chage -P $TEMPDIR -l chagetest1 > tst-chage.out2RET1=$?cat << EOT > tst-chage.expect2Minimum: 7Maximum: 92Warning: 14Inactive: 0Last Change: Feb 29, 2000Password Expires: May 31, 2000Password Inactive: NeverAccount Expires: Feb 29, 2004EOTdiff -q -u tst-chage.expect2 tst-chage.out2RET2=$?rm -rf $TEMPDIRif [ $RET1 != 0 -o $RET2 != 0 ] ; then exit 1else exit 0fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -