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

Re: cd to folder with spaces - in a script



On Thu, May 21, 2009 at 08:34:48PM +0200, Michael Casey wrote:
> yeah, SOLVED: :))
> 
> clear; find . -type d | while read FOLDERNAME; do $(cd "$FOLDERNAME"); done

I'm not sure what it is exactly that you try to do, but:

  $(cd "$FOLDERNAME")

chdir-s into that directory in a subshell and then returns the output of
that command (which is always empty) as the command to execute. That
command is empty which is a syntax error in the while loop.

-- 
Tzafrir Cohen         | tzafrir@jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir@cohens.org.il |                    |  best
ICQ# 16849754         |                    | friend


Reply to: