how to set 'head' output width
Hey,
I'm working on a script that runs through a bunch of MT940 files, but since I'm pretty new to this stuff I'm using head quite often to make sure I still got the formatting correct.
However, head insists on using about 60 columns for it's output, making it pretty inconvenient to read and understand long lines. Other programs like ls and echo don't show this behaviour, they just go by $COLUMNS which is 180.
Now the best thing I found so far was someone recommending (in a slightly different context) to set the env variable COLUMNS specific to a command, which seemed to work for the problem in question. The set command was something like "COLUMNS = 180 'command_name' -c -b -n 1 > 'command_name'.log"
Now, not only did this not work for me - just went into some loop without output trying that -, on a minor note: I don't even understand the flags here, so could someone tell me in what man or info I could read up on this? Is it somewhere in the maze of the man bash?
Nevermind, my actual problem is: how do I set the number of columns head will use for its output?
Aaaaand ... why does head | echo not work?
Sorry for this being my first post - I'm afraid I'll have to threaten it won't be my last though - and thanks for any help.
Best wishes
//sorry:
running bash version 4.3.46(1)-release
Last edited by MrMeeSeeks; 01-29-2017 at 10:10 AM.
|