This function checks if an attribute has been passed and if not, asks user for input.
I'm new in bash scripting and would like to get some feedback. Is it okay or should I refactor this code somehow to make it more concise?
#!/usr/bin/env bash
fn() {
if [ -z "$1" ]; then
read -p "username:" username
else
username=$1
fi
echo "username is $username"
}