I want to enter an output of command with a few pipes to var. The code I wrote looks like this:
curl https://www.gentoo.org/downloads/signatures/ | grep 0x | cut -d '>' -f3 | cut -d '<' -f1 | while read line; do
gpg --recv-keys $line
tempfingerprint= `gpg --fingerprint $line | head -2 | tail -1 | cut -d'=' -f2 | cut -d ' ' -f2-12`
echo $tempfingerprint
cut when I try to echo the results (last code line) I get an error message. I debugged it, and this is the debug log:
336 + head -2
336 + tail -1
336 + cut -d= -f2
336 + cut -d ' ' -f2-12
336 + gpg --fingerprint 0xBB572E0E2D182910
36 + tempFingerPrint= 36 + 13EB BDBE DE7A 1277 5DFD B1BA BB57 2E0E 2D18 2910
./gentoo-stage.sh: line 36: 13EB: command not found
How can I assign the all fingerprint to the variable?