Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # by OuNiS 11.2023
- #
- # man test to check IF statement
- #
- # if [ -n $1 ] ; then
- if test -n "$1" ; then
- # if [ -s $1 ] ; then
- if test -s "$1" ; then
- echo "'$1' - exists..."
- else
- bell
- echo "'$1' - not exists..."
- fi
- else
- bell
- # https://stackoverflow.com/questions/24980679/double-exclamation-in-bash-scripthttps://stackoverflow.com/questions/24980679/double-exclamation-in-bash-script
- echo ERR: missing parameter \!\!\!
- echo "How to use?:"
- echo -e "\tcheck_file_exists <file_location>"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement