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.

2
  • What did you try for yourself? Did you look at similar questions before? Commented Apr 26, 2017 at 9:45
  • to parse into a script - how should look the final result? Commented Apr 26, 2017 at 9:47

1 Answer 1

-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
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, that article helped solve my problem