bash - how to get the next word of a specified word in string -


i searched here , there couldn't find appropriate answer question. apologize if answered.

i have bash script connects different oracle databases perform different operational tasks. problem want hash password's , store them beside users in string this

dbauth="user1 user1password user2 user2password ... usern usernpassword" 

i need function username , return password me ( next word )

with regards.

instead of string, use associative array:

dbauth=([user1]=user1password [user2]=user2password ... [usern]=usernpassword) 

then can use ${dbauth[$user]} password username.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -