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
Post a Comment