Skip to main content
added information posted as a comment
Source Link
Gilles 'SO- stop being evil'
  • 865.5k
  • 205
  • 1.8k
  • 2.3k

I need to check 2 assetions:

  1. The file content format
  2. Iterate over that content:

So, the content file must be:

key1=value
key2=value2
...

So, each line must assert <key=value>have the format key=value. Spaces are not allowed before or after the =. This file content has to be an env format file.

By other hand, I need to split out each line into a key and a value inside a loop.

Any ideas?

I need to check 2 assetions:

  1. The file content format
  2. Iterate over that content:

So, the content file must be:

key1=value
key2=value2
...

So, each line must assert <key=value>.

By other hand, I need to split out each line into a key and a value inside a loop.

Any ideas?

I need to check 2 assetions:

  1. The file content format
  2. Iterate over that content:

So, the content file must be:

key1=value
key2=value2
...

So, each line must have the format key=value. Spaces are not allowed before or after the =. This file content has to be an env format file.

By other hand, I need to split out each line into a key and a value inside a loop.

Any ideas?

Source Link
Jordi
  • 335
  • 5
  • 10

Shell: Check line format file and loop over file lines

I need to check 2 assetions:

  1. The file content format
  2. Iterate over that content:

So, the content file must be:

key1=value
key2=value2
...

So, each line must assert <key=value>.

By other hand, I need to split out each line into a key and a value inside a loop.

Any ideas?