Let's get to the core problem

Eric A. Ayer mwalker at ee.pdx.edu
Sat Jun 24 21:49:40 PDT 2000


> >Related to this last item, I have a shell programming question.  I 
> wanted to
> >write a shell function to copy directories from one place to another 
> recurs-
> >ively, creating sub-dirs as needed and checking for overwrites.  This 
> is one
> >of those functions in vars.  I found that shell functions can't be 
> recursive,
> >so I need to get a directory listing into a shell variable and step 
> through
> >each item.  Easy enough to create the variable - dirvar=`ls`.  But how 
> do you
> >get one item out of that variable?  I remember doing this before, 
> sucking out
> >one word from the variable, but I can't remember how.  Any ideas?
> 
> The only thing I can think of write now is to use cut.
> 
> Avery Fay

I looked at cut, but it wanted a file.  However, now that you mention it maybe
that is what I used before - just pipe in the text of the shell variable, set
the delimeter, and go.  I'll try :)

					-Erik

--
Mail archive: http://www.pcrdallas.com/mail-archives/alfs-discuss
IRC access: server: irc.linuxfromscratch.org port: 6667 channel: #LFS
Unsubscribe: email alfs-discuss-request at linuxfromscratch.org and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)



More information about the alfs-discuss mailing list