Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- FILE=$1
- if [ -f $FILE ];
- then
- echo "File $FILE exists."
- else
- echo "File $FILE does not exist."
- fi
- #!/bin/bash
- FILE=$1
- if [ $FILE does not exist ];
- then
- echo "File $FILE does not exist."
- fi
- if [ ! -f /tmp/foo.txt ]; then
- echo "File not found!"
- fi
- #!/bin/bash
- FILE=$1
- if [ ! -f "$FILE" ]
- then
- echo "File $FILE does not exists"
- fi
- [[ -f $FILE ]] || printf '%s does not exist!n' "$FILE"
- if [[ ! -f $FILE ]]; then
- if [[ -L $FILE ]]; then
- printf '%s is a broken symlink!n' "$FILE"
- else
- printf '%s does not exist!n' "$FILE"
- fi
- fi
- if [ ! -f "$file" ]; then
- echo "$file"
- fi
- test -f "$file" || echo "$file"
- [ -f "$file" ] || echo "$file"
- #!/bin/bash
- file=./file
- if [ -e "$file" ]; then
- echo "File exists"
- else
- echo "File does not exist"
- fi
- #!/bin/bash
- file=./file
- if [ ! -e "$file" ]; then
- echo "File does not exist"
- else
- echo "File exists"
- fi
- $ [ -f "/$DIR/$FILE" ] || echo "$FILE NOT FOUND"
- $ [ -f "/$DIR/$FILE" ] && echo "$FILE FOUND"
- $ [ -f "/$DIR/$FILE" ] || { echo "$FILE NOT FOUND" ; exit 1 ;}
- $ [ -f ]
- $ echo $?
- 0
- $ [ -f "" ]
- $ echo $?
- 1
- #!/bin/sh
- FILE=$1
- if [ ! -f "$FILE" ]
- then
- echo "File $FILE does not exist."
- fi
- if [ ! -f /tmp/foo.txt ];
- then
- echo "File not found!"
- fi
- if [ ! -f /tmp/foo.txt ]
- then echo "File not found!"
- fi
- if ! [ -f /tmp/foo.txt ]
- then echo "File not found!"
- fi
- if ! [ -f /tmp/foo.txt ]; then echo "File not found!"; fi
- [ ! -f /tmp/foo.txt ] && echo "File not found!"
- [ -f /tmp/foo.txt ] || echo "File not found!"
- #!/bin/bash
- FILE=$1
- if [ -f $FILE ];
- then
- echo "File $FILE exists"
- else
- echo "File $FILE does not exists"
- fi
- test -e FILENAME && echo "File exists" || echo "File doesn't exist"
- check-file(){
- while [[ ${#} -gt 0 ]]; do
- case $1 in
- fxrsw) [[ -f "$2" && -x "$2" && -r "$2" && -s "$2" && -w "$2" ]] || return 1 ;;
- fxrs) [[ -f "$2" && -x "$2" && -r "$2" && -s "$2" ]] || return 1 ;;
- fxr) [[ -f "$2" && -x "$2" && -r "$2" ]] || return 1 ;;
- fr) [[ -f "$2" && -r "$2" ]] || return 1 ;;
- fx) [[ -f "$2" && -x "$2" ]] || return 1 ;;
- fe) [[ -f "$2" && -e "$2" ]] || return 1 ;;
- hf) [[ -h "$2" && -f "$2" ]] || return 1 ;;
- *) [[ -e "$1" ]] || return 1 ;;
- esac
- shift
- done
- return 0
- }
- FILE=$1
- [ ! -e ${FILE} ] && echo "doest not exist" || echo "exist"
- echo "entre file"
- read a
- if [ -s /home/trainee02/simmant/$a ]
- then
- echo "yes file is there "
- else
- echo "soryy file is not there"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement