linux - How to read text file to parameters -


i’ve file contain following pattern

aaaa0000   aaaa0000@gmail.com bbbb0001   bbbb0001@gmail.com … 

i need read value file , put variable e.g.

  1. aaaa0000 should user
  2. aaaa0001@gmail.com should email

when try following

while ifs= read -r file;  [[ $email == *@* ]] && [[ $user==“%s%18d\n”]] 

i don’t right values . how should change read spreated user , email value varibles?

pass names of variables want parse content arguments read:

while read -r user email;   echo "user <${user}> has email <${email}>" done 

for extensive discussion, see bashfaq #1.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -