I have a file named "test.log" with contents:
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 [kthreadd]
Then I use while-read command to process it:
cat test.log |while read line; do echo $line ; done
and It returns
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 a
Wired,something was truncated.What happend?
$line,[kthreadd]is taken as a glob pattern that will expand to all files that match it and you likely have a file calledain the current working directory.