'Assign cURL response to variable without showing it on the command line bash

I am currently making a bash script where I would like to make a cURL request and assign its response to a variable. This part is easy, but is there a way to do it without the response also being printed out on the command line?

Here's what I have right now:

session_curl="$(pbpaste)"

{do some other stuff here}

tmp=$(mktemp)
echo "$session_curl" > "$tmp"
chmod +x "$tmp"
"$tmp"
rm "$tmp"



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source