Yes, and many thanks for *not* posting an example line...
If it's for some weird reason a file w lines like brittany;billg;ellisonl then ($each will hold the name):
for each in $(cat <file> | tr ";" " "); do <command> <args> $each; done
If it's a file w lines like
brittany;"Weird chick";/home/users/b/brittany
billg;"Luser";/home/billg
ellisonl;"dunno";
you'll have to AND sort out the fields AND subst any missing data.
In example all records need to have equal amount of fields:
cat <file> | while read raw; do
# make array
myArray=( $(echo ${raw} | tr ";" " ") )
#so username is ${myArray[0]}, etc etc.
# example home fscker:
myArray[2]=/home/$(basename ${myArray[2]})
if [ -z "${myArray[2]}" ]; then myArray[2]=/home/${myArray[0]}; fi
<command> <args> -d ${myArray[2]} ${myArray[0]}
done
|