roswell:~ yama$ uname -a
Darwin roswell 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc
roswell:~ yama$ echo $SHELL
/bin/bash
roswell:~ yama$ gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1666)

の環境で、以下の shell script を実行すると

#1 では、GCC33 と表示されるのですが、
#2 では、GCC33 と表示されません。

#2 の時は、何が悪くて環境変数 GCCVERに GCC33 が設定されないのか
御教授願えますでしょうか?

#! /bin/sh
CC=gcc

# 1
$CC -v 2>&1 \
| tail -n 1 \
| awk '{ printf("GCC%s\n",$3) }' \
| sed s/\\.//g

# 2
export GCCVER=\
`$CC -v 2>&1 \
| tail -n 1 \
| awk '{ printf("GCC%s\n",$3) }' \
| sed s/\\.//g`
echo $GCCVER