I'm trying to modify a script that read usernames/password from a file which is like this:
user1 pass1
user2 pass2
user3 pass3
I can't get the script to read the space between the users and pass. What can I use to delimit this space? This is my code:
for row in `cat $1`
do
if [ $(id -u) -eq 0 ]; then
username=${row%:*}
password=${row#*:}
#echo $username
#echo $password
I know I have to change the stuff in ${row%:} and ${row%:}
What do I have to put so it sees the space between user1 pass1 ?