#!/bin/sh # usage: ./viewPost.sh --filename= # Parse the arguments for arg in "$@" do case $arg in --filename=*) 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