LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 09: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, 09: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, 09:48 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Set your field seperator to a newline first:
IFS="
"
 
Old 08-24-2003, 10: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


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 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 02:28 AM
mount hdd but not filesys found? JsCAMRY Linux - Hardware 3 06-27-2004 02:57 PM
ext3 filesys raven Linux - General 3 04-21-2002 12:42 PM

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

All times are GMT -5. The time now is 09:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration