linux bash file verification
if [ $# -eq 1 ] && [ -f $1 ]; then
file=$1
if [[ ! -s $file ]]; then
echo "O ficheiro está vazio!"
echo "Por favor, insira um ficheiro válido."
exit 1
fi
elif [ $# -gt 1 ]; then
echo "Demasiados ficheiros introduzidos!"
echo "Por favor, insira apenas um ficheiro."
exit 1
elif [ $# -eq 0 ] || [ ! -f $1 ]; then
echo "O ficheiro inserido é inválido!"
echo "Por favor, insira um ficheiro válido."
exit 1
fi
Also in C++:
- powershell system.net.dns gethostaddresses error
- git push current project to master
- how to remove git hooks
- how to assign values from a loop in bash to a single variabel
- git borrar rama local y remote
- docker run npm install express syntax
- heroku create app
- ubuntu check server timezone
- cancel a merge git
- ubuntu create archive split
- ubuntu version
- linux find and delete files with name
- install redis ubuntu
- install intellij linux command line
- sed all except last
- how to I list powershell functions
- how to install wps office in ubuntu
- ssh copy folder from local to remote
- find and kill process
- vendor/autoload.php download
- linux command if directory exists
- how to show problem il linux or ubuntu
- mono-complete arch
- convert .py to .exe using pyinstaller