LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-24-2003, 08:41 AM   #1
chr15t0
Member
 
Registered: Jun 2002
Location: London
Distribution: Slackware
Posts: 201

Rep: Reputation: 30
help with filesys oneliner


guys,

just fiddling with a one liner.. a bit like the following:
Code:
for i in `ls -R /home/chris/incoming/mp3/| grep / | cut -f1 -d":"`; do ls -al $i;done
however, it barfs in directories which contain either a space, or a '.'

Can anyone suggest a quick way to fix this so that all directories are liststed.. Perhaps there's some trick I can pull with quoting.

thanks,
christo
 
Old 08-24-2003, 08:43 AM   #2
chr15t0
Member
 
Registered: Jun 2002
Location: London
Distribution: Slackware
Posts: 201

Original Poster
Rep: Reputation: 30
doh

find fixed it

cx
 
Old 08-24-2003, 08:48 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Set your field seperator to a newline first:
IFS="
"
 
Old 08-24-2003, 09:49 AM   #4
chr15t0
Member
 
Registered: Jun 2002
Location: London
Distribution: Slackware
Posts: 201

Original Poster
Rep: Reputation: 30
Hmm - that's a new one to me. what would that do? On my system, IFS is not set by default


christo
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
writable 'scratch space' for data between linux and winxp filesys questions... servnov Linux - General 2 02-11-2005 01:28 AM
mount hdd but not filesys found? JsCAMRY Linux - Hardware 3 06-27-2004 01:57 PM
ext3 filesys raven Linux - General 3 04-21-2002 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration