LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 07-12-2005, 10:40 AM   #1
Phiebie
Member
 
Registered: Oct 2004
Location: Austria
Distribution: Debian testing
Posts: 102

Rep: Reputation: 17
Ls and cut problem


Hi folks,

Coreutils 5.2.1 from Sarge stable.
ls -alR /home > overview is supposed to yield a neatly tab-delimited output of all columns in file overview, isn't it?
cut --fields=1-5 overview > overview1 should result in only the first 5 columns being written to overview1, isn't it?
Well, it ISN'T.
Whatever I tried with parameters and also piping 'ls' directly to 'cut', I get no desired result. In all cases the output of 'cut' is the complete 'ls'-overview. Only if I add -s to 'cut' I get a different reslult, an output of _exactly_ 0 bytes, hahaha.
Looking with a hexeditor into overview, yes you are right already, does not show one single tab wherever, only spaces to pad for a nice human-reading.
Using in 'cut' --bytes=1-35 (as example) in stead of --fields=1-5 moreoften shows an unusable result (last column cut off or next column already in the picture) as it gives the desired output:
-rw-r--r-- 1 peter peter 82123
drwxr-xr-x 2 peter peter 48 Fe

a) has anyone of you encountered the same problem?
b) has anyone of you maybe a solution to add the tabs in 'ls'? Or is this a more or less severe bug in 'ls'?

Thanks for your help.
 
Old 07-12-2005, 01:20 PM   #2
koen plessers
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Mint
Posts: 191

Rep: Reputation: 30
Hello

Indeed, what looks like a tab on first site, is one or more spaces.

More info on the cut command can be found on http://learnlinux.tsf.org.za/courses...g/ch03s04.html

Have a lot of fun

Koen Plessers
 
Old 07-14-2005, 07:10 AM   #3
Phiebie
Member
 
Registered: Oct 2004
Location: Austria
Distribution: Debian testing
Posts: 102

Original Poster
Rep: Reputation: 17
[QUOTE]Originally posted by koen plessers
[B]Hello Koen,


More info on the cut command can be found on http://learnlinux.tsf.org.za/courses...g/ch03s04.html

Tnx, a very usefull site.

Groetjes uit Oostenrijk.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cut question krock923 Programming 1 10-19-2005 04:03 PM
How can I cut something between quotes? jfall Linux - General 2 02-09-2005 09:03 PM
mozilla cut/copy and paste problem gw1500se Mandriva 5 04-27-2004 08:35 PM
cut-problem dahljor Programming 2 07-08-2003 12:58 PM
cut and paste c0c0deuz Linux - Newbie 6 11-01-2001 12:38 PM


All times are GMT -5. The time now is 02:42 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration