pathScripts/txtsort

17 lines
264 B
Text
Raw Normal View History

#!/bin/bash
# Checking if the user provided a file name
if [ $# -ne 1 ]; then
echo "Usage: $0 filename"
exit 1
fi
# Checking if the given file is readable
if ! [ -r "$1" ]; then
echo "The file '$1' is not readable or does not exist."
exit 1
fi
sort $1