Let's get to the core problem

Richard Richard at reika.demon.co.uk
Sat Jun 24 23:54:23 PDT 2000


> A lot of the installation of the various packages comes down to running
shell
> commands.  Granted, a shell script is not the answere to the entire
process of
> the install, but a lot of things may come down to being shell scripts.
One
> possibility I see is that the commands in the shell scripts could be run
one
> by one in a sort of single step mode, so the user can see and/or change
what
> will be run.  I can imagine something like an "ncurses screen" showing the
> commands for configuring, making, etc, either just as they are running or
in
> interactive mode.
>
How about a general purpose bash debugger

> Lately, I have been working on my own set of install scripts.
Are they available on line?
Can we work together?
My scripts are at:
http://www.reika.demon.co.uk/index.html

>
> 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.

I was too lazy to write one:
cp
-b --backup    make backup before removal
-f --force     remove existing desitinations, never prompt
-i --interactive
-r             copy recursively, non-directories as files
-R             copy recursively


> I found that shell functions can't be recursive,

I found they could be recursive. See "help local", and watch out
for the unusual behaviour of the induction variable of a for loop.

> 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?

$(ls | cut ...) has been metioned and gets you one, but as your source is
ls,
perhaps you would prefer:
for file in $(ls $1); do
  echo $file
done

Richard


--
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