#!/bin/bash

# 1. Check for a single positional parameter
if [ $# -ne 1 ]; then
    echo "Please provide a single argument."
    exit 1
fi

# Assign first argument to a variable
file_or_dir=$1

# 2. Check if is file or directory in the directory
if [ ! -e "$file_or_dir"]; then
    echo "$file_or_dir does not exits in the current dir."
    exit 1
fi

# 3. If it's a regular file, check if it is empty or not
if [ -f "$file_or_dir" ]; then
    if [ -s "$file_or_dir" ]; then # -s returns size, if it exits cannot be zero
        echo "$file_or_dir is a regular file and is not empty."
    else
        echo "$file_or_dir is a regular file and is empty."
    fi
elif [ -d "$file_or_dir" ]; then
    echo "$file_or_dir is a directory. Listing its contents:"
    ls "$file_or_dir"
else
    echo "$file_or_dir is neither..."
fi