You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
308 B
21 lines
308 B
1 year ago
|
#!/bin/sh
|
||
|
|
||
|
# usage: ./viewPost.sh --file=<filename>
|
||
|
|
||
|
# 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
|