Given the following file
zaiste:admin
zosia:regular
krysia:admin
Use IFS
variable (Input Field Separator) shell script to split each line from an input file on :
character:
#!/bin/bash
while IFS=':' read -r name role
do
echo $name
echo $role
done < users.txt