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

Re: bash scripting q



In your example you are saying that $a is the function 'do_chrono', so
when you run $a, it runs the function and prints out the result. As
another poster indicated, you need to do it slightly differently:

# execute and store result in $a
a=$( do_chrono )

# print
echo $a


Atle
-
Flying Crocodile Inc, Unix Systems Administrator

On Wed, 27 Sep 2006, Hugo Vanwoerkom wrote:

> Hi,
>
> On my way to elapsed time in a bash script, I created the do_chrono
> command. It pumps the elapsed time to stdout.
>
> So if I do:
>
> a=do_chrono
>
> and then:
>
> $a
>
> I get: 0:3:19.
>
> Problem: I can't use that $a anywhere, e.g. if I say:
>
> echo $a
>
> I would expect to see 0:3:19 again, but I don't, it says
>
> do_chrono
>
>
> How do I use that $a in command parameters, like logger?
>
> Thanks!
>
> H
>



Reply to: