0

i've got a text file with configuration in that I want to parse into a script. Any idea how I do this?

config;

name = joe
age = 38
location = oxford

For example, i'll ask the question to the user;

Would you like to get the user details? [Y/N]:

Then after the user says yes it will parse this config into the commands i'm building.

Aaron
  • 65
  • 5

1 Answers1

-1

I suggest you to use the cut command, here is the manual : https://linux.die.net/man/1/cut

And here is an example for your case :

cut -d'=' -f1 /path/file
cut -d'=' -f2 /path/file
ShellCode
  • 1,072
  • 8
  • 17