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

Re: globbing and set a command



On 3 February 2010 08:04, ugaciaka <ugaciaka@xxxxxxxxx> wrote:
> Hi,
>
> for setting the cpu governor I write:
>
> cpufreq-set -c 0 -g conservative
>
> cpufreq-set -c 1 -g conservative
>
> (I have dual core cpu)
>
> 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.

A for loop probably makes the most sense here, but you can also do
something crazy like
eval 'cpufreq-set -c '{1..2}' -g conservative;'

-- 
Mikael Magnusson



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