#!/bin/sh # usage: ./viewPost.sh --file= # Parse the arguments for arg in "$@" do case $arg in --file=*) file="${arg#*=}" ;; esac done # Check if the file exists and is a regular file if [ -f "$file" ]; then cat "$file" else echo "File does not exist" fi