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

Re: for i in *

On Sun, 20 May 2001, Hans <hansfong@zonnet.nl> wrote:

>I still don't understand the proper syntax for this: I want to process
>multiple files, e.g. symlinking a bunch or converting graphics.
>for i in *;do 'ln -s $i /home/newdir/$i';done
              ^^^                      ^^^

You need grave accents here. Try:

for i in *; do `ln -s $i /home/newdir/$i`; done

Also, * will give the file name only, you need the full (relative or
absolute) path for the symlinks to work.

>won't work. 
>Could someone please explain the rules for doing stuff like this, e.g. when
>to use quotes and what quotes, when to write files to a new file and
>renaming them back. I would appreciate this a lot as I need to do a lot of
>this kind of stuff. Thanks --Hans

Philipp Lehman <lehman@gmx.net>

Reply to: