3

I need save into variable the file content (json string).

I try several methods, in particular:

#!/bin/bash

myjson=cat path-to-file/file.json

but nothing not work.

How to correctly implement this task?

Valentyn Hruzytskyi
  • 557
  • 2
  • 10
  • 23

1 Answers1

2

You can try this:

#!/bin/bash

myjson=$(cat patch/file.jsn)
kukulo
  • 1,995
  • 10
  • 21