I have a text file I'm outputting to a variable in my shell script. I only need the first 50 characters however.
I've tried using cat ${filename} cut -c1-50
but I'm getting far more than the first 50 characters? That may be due to cut
looking for lines (not 100% sure), while this text file could be one long string-- it really depends.
Is there a utility out there I can pipe into to get the first X characters from a cat
command?
|
?cat ${filename} | cut -c1-50
– DisplayName Nov 13 '14 at 18:28