Re: bash scripting q

2006-09-29 Thread Kevin Mark
On Fri, Sep 29, 2006 at 08:02:38AM -0500, Hugo Vanwoerkom wrote: > Kevin Mark wrote: > >On Wed, Sep 27, 2006 at 09:22:05PM -0500, Ron Johnson wrote: > >>how about > >> b=`$a` > >> echo $b > > > >or > >echo $($a) > > > Bingo!!! Thanks! > Is that in the Advanced Bash-Scripting Guide? > H > Hi H

Re: bash scripting q

2006-09-29 Thread Hugo Vanwoerkom
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 ag

Re: bash scripting q

2006-09-29 Thread Hugo Vanwoerkom
Kevin Mark wrote: On Wed, Sep 27, 2006 at 09:22:05PM -0500, Ron Johnson wrote: how about b=`$a` echo $b or echo $($a) Bingo!!! Thanks! Is that in the Advanced Bash-Scripting Guide? H echo `$a` -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Troub

Re: bash scripting q

2006-09-29 Thread Hugo Vanwoerkom
Atle Veka wrote: 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 Yup

Re: bash scripting q

2006-09-29 Thread Hugo Vanwoerkom
Ron Johnson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/27/06 18:51, 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

Re: bash scripting q

2006-09-28 Thread Kevin Mark
On Wed, Sep 27, 2006 at 09:22:05PM -0500, Ron Johnson wrote: > > how about > b=`$a` > echo $b or echo $($a) echo `$a` -- | .''`. == Debian GNU/Linux == | my web site: | | : :' : The Universal | debian.home.pipeline.com | | `. `' Operating System| go to coun

Re: bash scripting q

2006-09-27 Thread Atle Veka
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

Re: bash scripting q

2006-09-27 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/27/06 18:51, 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. > > P