#!/bin/csh -f
foreach line (`cat test.txt`)
echo "$line"
end
test.txt file contains following content :
How to Ask
Is your question about programming?
We prefer questions that can be answered, not just discussed.
Provide details. Share your research.
If your question is about this website, ask it on meta instead.
But on running the above csh script i am getting following output which prints on the basis of space delimiter instead of new line
./test.csh
You can use this;
#!/bin/csh -f
foreach line ( "`cat test.txt`" )
echo $line
end
Test :
$ csh test.csh
How to Ask
Is your question about programming
We prefer questions that can be answered, not just discussed.
Provide details. Share your research.
If your question is about this website, ask it on meta instead.