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?

1 Answers1

2

You can try this:

#!/bin/bash

myjson=$(cat patch/file.jsn)
kukulo
  • 2,045
  • 12
  • 22