On Tue, Aug 14, 2001 at 11:57:18AM -0700, Justin Bengtson wrote:
> is it possible, in a BASH script, to invoke a program, stuff the return into
> a variable and perform actions based on what was returned?  what if the
> invoked program returned multiple results?  is there a way to sort them out
> and assign them each variables?

Yes.

For instance:
  bar=$(pwd)
  foo=($(ls))

Will assign the name of the current directory to bar and the file
names in the current directory to the array foo.

You can also read a file line-by-line with "read".

I caution against over-complexity in bash scripts, however.  In
particular, variable values containing spaces are apt to be
problematic.

Randolph

Reply via email to