I am reading from csv file and echoing it line by line.
#!/bin/bash
while IFS=";" read username first last password
do
echo "I got:$username $first $last $password"
if [ -z "$password" ]
then
echo "null"
fi
done < users.csv
This is my csv file and for the null passwords null is not echoed.
lm;Lukáš;Masák;kjfask
spilk;Lukáš;Rasák;56456
kour;Lukáš;drtič;
hole;Lukáš;March;
lmmama;Lukáš;March;