Hello there to all the bash scripting masters i see we have in this forum!
I am new here, and generally in bash scripting.
I came from windows batch scripting and i am having troubles reading files.
let me explain my problem:
i have a bash script in a dir called "dir1". Under that dir, there is another dir "dir2" and under that one is another called "dir3" wich has a file called "logindata" so the tree is as follows:
dir1 -> script.sh
|_ dir3 -> logindata
the file logindata contains three values in csv format, so its contents are something like "user1,pass4user1,server.dns.com"
my intention with the script.sh is to read that line from logindata and assign these three values to their vars so i'm trying this:
while read usrname passwrd srver
done < dir2/dir3/logindata
I believe that the problem is the way i reference the file in the "done <" line but i cant find a way to solve it.
If someone can help me i would appreciate it so much.
Thank you in advance.