Hello how can I read a json from filesystem with bash and pass the string as an argument to a python script? I tried this. But it does not work
config=`cat test.json | tr '\n' ' '`
python3 script.py\
--config $config \
Hello how can I read a json from filesystem with bash and pass the string as an argument to a python script? I tried this. But it does not work
config=`cat test.json | tr '\n' ' '`
python3 script.py\
--config $config \
Why eliminate the newlines?
python3 script.py --config "$(<test.json)"
Or if you really need them gone,
python3 script.py --config "$( tr "\n" ' ' < test.json)"