Re: cd to folder with spaces - in a script

2009-05-29 Thread jteb
Just find . -type d | while read FOLDER; do cd "${FOLDER}"; I reckon ( don't really know the case ) I usually do something like this (might not be most efficient, but I like it for clarity. # for i in $(find . -type d); do cd "${i}"; whatever you want to do in i; cd ..; done Cheers, Jan

Using 'find' and 'read' to traverse list, allowing user input inside the loop [Re: cd to folder with spaces - in a script]

2009-05-25 Thread MartinG
On Fri, May 22, 2009 at 10:09 PM, Steven W. Orr wrote: > > ii=0 > while read -d $'\000' FOLDERNAME > do >    savd=$PWD >    cd "$FOLDERNAME" >    ii=$((ii+1)) >    cd "$savd" > done <(find . -type d -print0) This is all cool, as long as you don't want user input in the middle of that loop, using

Re: cd to folder with spaces - in a script

2009-05-24 Thread Michael Casey
I used it for this: http://pastebin.ca/1432758 generating m3u files for each subfolder too -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Re: cd to folder with spaces - in a script

2009-05-22 Thread Bill Davidsen
Patrick O'Callaghan wrote: On Thu, 2009-05-21 at 19:40 +0200, Michael Casey wrote: How can I cd into a dir, when it contains spaces, and I need to use it in a script? the directory: /home/user/this is a folder/something normally I would use: cd /home/user/this\ is\ a\ folder/something/ but in

Re: cd to folder with spaces - in a script

2009-05-22 Thread Steven W. Orr
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday, May 21st 2009 at 13:40 -, quoth Michael Casey: =>How can I cd into a dir, when it contains spaces, and I need to use it in a =>script? => =>the directory: =>/home/user/this is a folder/something => =>normally I would use: =>cd /home/

Re: cd to folder with spaces - in a script

2009-05-21 Thread g
Peter Langfelder wrote: > Had the exact same problem, using cd "$FOLDER", i.e., adding the > double quotes around the $FOLDER, solved it for me. that can do it, and you can use age old '?' for spaces and special chars. -- peace out. tc,hago. g . in a free world without fences, who nee

Re: cd to folder with spaces - in a script

2009-05-21 Thread Michael Casey
yeah, SOLVED: :)) clear; find . -type d | while read FOLDERNAME; do $(cd "$FOLDERNAME"); done Thank you!! -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidel

Re: cd to folder with spaces - in a script

2009-05-21 Thread Patrick O'Callaghan
On Thu, 2009-05-21 at 19:40 +0200, Michael Casey wrote: > How can I cd into a dir, when it contains spaces, and I need to use it > in a script? > > the directory: > /home/user/this is a folder/something > > normally I would use: > cd /home/user/this\ is\ a\ folder/something/ > > but in a script

Re: cd to folder with spaces - in a script

2009-05-21 Thread Peter Langfelder
On Thu, May 21, 2009 at 10:40 AM, Michael Casey wrote: > How can I cd into a dir, when it contains spaces, and I need to use it in a > script? > > the directory: > /home/user/this is a folder/something > > normally I would use: > cd /home/user/this\ is\ a\ folder/something/ > > but in a script I c

cd to folder with spaces - in a script

2009-05-21 Thread Michael Casey
How can I cd into a dir, when it contains spaces, and I need to use it in a script? the directory: /home/user/this is a folder/something normally I would use: cd /home/user/this\ is\ a\ folder/something/ but in a script I cant just add the "\" like: find . -type d | while read FOLDER; do cd $FO