Created
June 29, 2017 04:44
-
-
Save xiangzhuyuan/48f6cd875048fafe28803200926e0b1a to your computer and use it in GitHub Desktop.
check file exist or empty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pidFile=~/test1 | |
if [ ! -s ${pidFile} ];then | |
echo 'not exist or empty, touch this file' | |
touch ${pidFile} | |
fi | |
cat $pidFile | |
cat $pidFile|wc -l | |
ls -alht $pidFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment