0

In a bash script I have this line

$var=$(printf "$otherVar" | wc -l)

which is failing with the error

../test.sh: line 30: =60: command not found

which I find entirely inscrutable. Presumably =60 is something it found in the contents of $otherVar, but why would that cause problems for either printf or wc? It should just be data.

Charles
  • 11,269
  • 13
  • 67
  • 105

0 Answers0