[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "cut" command not working as expected

David writes:

> I want to cut the first two file names from the list ... To my way of 
> thinking this should be easy ...
> cut -d' ' -f2 $directory
> The xterm goes nuts and ends up in hyroglyphics ! At a guess I would say 
> that the white space between .gz & 200... may not be space but may have 
> a different ascii value. I have not found a utility to display raw ASCII 
> for a file yet to check this out.


       cut [OPTION]... [FILE]...

Your $directory is expanding out to each file which is compressed
data. cut reads the data in from the files, modifies it, and then
sends it to stdout. When the data is displayed on xterm, xterm
interprets the raw data in weird ways. "setterm -reset" will correct
this after the fact.

ls -r --format=single-column | tail +3



Reply to: