Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: globbing and set a command



ugaciaka wrote:
[...]
> But I want write a unique command like
>
> cpufreq-set -c (0|1) -g conservative
>
> I was thinking of doing a for loop, but before I wanted to know if
> there was a Âglobbing-way.

"Globbing" is for matching "stuff". Files in particular. That cannot
help you here.

Let's see if I'm with you so far:
You basically want to CPU 0 and 1 to be controlled by the conservative
governor, right? I think `cpufreq-set' let's you specify options like
this: "-c0" instead of this: "-c 0". If you're allowed to specify the -c
option more than once per call of the program, you could do this:

  % cpufreq-set -c{0,1} -g conservative

That would execute the following command:

  % cpufreq-set -c0 -c1 -g conservative

No character advantage it seems.

If cpufreq-set doesn't allow that, you need to go with a loop. Others
described that in this thread already.

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



Messages sorted by: Reverse Date, Date, Thread, Author