the variables line,word,char dont get value!
line= wc -l < $*
word= wc -w < $*
char= wc -m < $*
echo "Number of characters in test.txt is $char"
echo "Number of words in test.txt is $word"
echo "Number of lines in test.txt is $line"
the variables line,word,char dont get value!
line= wc -l < $*
word= wc -w < $*
char= wc -m < $*
echo "Number of characters in test.txt is $char"
echo "Number of words in test.txt is $word"
echo "Number of lines in test.txt is $line"
You have to wrap the command in $()
:
line=$(wc -l < $1)