Lately, I have been experimenting with the psps command, and sometimes long paths wrap to the next line (or two) and make it hard to read. I want to pipe the psps output into another program to limit the output to xx number of characters.
Here is what I have so far, but it doesn't work quite right:
ps aux | cut -c1-$(stty size | cut -d' ' -f2)
$(stty size | cut -d' ' -f2)$(stty size | cut -d' ' -f2) evaluates to 167, but doesn't seem to be valid input for cutcut.
Is there a way to get this type of syntax to work in bash?