I'm sure it is relatively simple, I just don't know how to do it.
#!/usr/bin/ksh
set `iostat`
myvar=6
I want to something like echo $($myvar) which i want interpreted as $($myvar) -> $(6) -> value
|
I'm sure it is relatively simple, I just don't know how to do it.
I want to something like |
||||
|
You can do this sort of thing with
The trick is to double-quote the string you feed to I got "%user" for the output, but I tried it on a multi-processor RHEL machine. |
|||
|
|
|
In ksh93 (and recent enough versions of mksh and bash), you can write
Zsh requires In older shells, including ksh88 and pdksh, your only recourse is to use |
|||
|
|
=sign in an assignment. I took the liberty of fixing your code since this isn't what the question is about. – Gilles Jun 23 '12 at 0:16