0

I am running into a bit of an issue / quirk here:

[root@s06p5bcsmta001 elves]# TEST=$(cat -e sendlog)
[root@s06p5bcsmta001 elves]# echo $TEST | wc -l
1
[root@s06p5bcsmta001 elves]# cat sendlog | wc -l
1050
[root@s06p5bcsmta001 elves]# TEST=$(cat sendlog)
[root@s06p5bcsmta001 elves]# echo $TEST | wc -l
1
[root@s06p5bcsmta001 elves]# echo -e $TEST | wc -l
1

How do I get the contents of the text file (with \n) into the variable?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
rjkfsm
  • 41
  • 4

1 Answers1

1

Yep - it was quoting...

echo "$TEST" | wc -l
1050

TY, Bodo!!

rjkfsm
  • 41
  • 4