java-tutorials/linux-bash/command-line-arguments/src/main/bash/userReg-flags.sh

15 lines
212 B
Bash

#!/bin/bash
while getopts u:a:f: flag
do
case "${flag}"
in
u) username=${OPTARG};;
a) age=${OPTARG};;
f) fullname=${OPTARG};;
esac
done
echo "Username: $username";
echo "Age: $age";
echo "Full Name: $fullname";