How can I accomplish this? I basically want to merge two variables onto the same line. I can do it with two FILES this way:
[ngreenfield@xxxxxx tmp]$ cat /tmp/users_in.list | awk -F "," '{print $2}' | cut -c -1 > first.initial
[ngreenfield@xxxxxx tmp]$ awk -F "," '{print $1}' /tmp/users_in.list | awk '{print $1}' > last.name
[ngreenfield@xxxxxx tmp]$ paste first.initial last.name | awk '{print $1$2}'
AAtun
JBatrez
SBevz
RCantley
TCheng
KChow
TCronk
JElizalde
KFindlay
CFrary
WHall
JHuang
AHunt
KJeffries
JKubiak
TMelton
CMolloy
ANg
SPatel
JPuckett
BRhoades
ARuiz
JSchmitt
TSenfleben
SSpangler
MSteingrebe
JTanner
DTrinh
JWalters
GWendover
DWright
PYara
EAcquisto
SBohannon
MChurchill
For some reason though I can't do this with variables:
[ngreenfield@xxxxxx tmp]$ FIRSTINITIAL=`cat /tmp/users_in.list | awk -F "," '{print $2}' | cut -c -1`
[ngreenfield@xxxxxx tmp]$ LASTNAME=`awk -F "," '{print $1}' /tmp/users_in.list | awk '{print $1}'`
[ngreenfield@xxxxxx tmp]$ paste $FIRSTINITIAL $LASTNAME | awk '{print $1$2}'
paste: A: No such file or directory
[ngreenfield@pdtscope003 tmp]$
Any ideas?