I am new to bash scripting and I need help creating a script that takes a file name as an argument, and then prints the number of lines, words, and characters in the file. The script should also print the name of the file, and handle errors such as when the file doesn't exist or the user didn't provide a file name as an argument. Can you help me create this script in bash?
Sure! Here is one way to write a Bash script for counting line, word, character counts from a given input filename:
```bash
#!/bin/bash
filename=$1 # set variable "filename" equal to the first command-line argument (i.e., the name of the file)
if [ -z "$filename" ]; then
    echo "No file provided!" >&2
    exit 1
fi

count_lines() {
  grep --only-matching '^[[:space:]]$' $filename | wc -l
}

count_words() {
  grep --only-matching '^\s*[a-zA-Z0-9]' $filename | wc -w
}

count_chars() {
  grep --only-matching '\S.*\n' $filename | tr -cd '[A-Za-z]+\n' |wc -c
}

total=$(count_lines + count_words + count_chars)
print_result "$filename has ${total} lines, ${count_lines}, ${count_words}, and ${count_characters}"
```