0

Can somebody help on this

I want to redirect the output from openssl to a variable in shell script. Like this

openssl rsautl -decrypt -inkey inp -in inenc -out [to some variable]

As of now I'm trying to achieve like this

var=$(openssl rsautl -decrypt -inkey inp -in inenc -out >(xargs))

But instead of that I need some one liner code to do this without using xargs

Dark Matter
  • 300
  • 2
  • 15

1 Answers1

3

Because openssl emits to stdout by default, you can omit the whole -out part:

var=$(openssl rsautl -decrypt -inkey inp -in inenc)

should work just fine.

Sabrina Jewson
  • 1,478
  • 1
  • 10
  • 17