Untitled

 avatar
unknown
plain_text
9 days ago
506 B
4
Indexable
#!/bin/bash
file_path="/home/user/check.txt"
if [ -e "$file_path" ]; then
    echo "The file '$file_path' exists."
    if [ -f "$file_path" ]; then
        echo "The file '$file_path' is a regular file."
    else
        echo "The file '$file_path' does not correspond to a regular file."
    fi
    if [ -r "$file_path" ]; then
        echo "The file '$file_path' is readable."
    else
        echo "The file '$file_path' is not readable."
    fi
else
    echo "The file '$file_path' does not exist."
fi
Editor is loading...
Leave a Comment