Repeat command

All those commands that we don't really use very often, but that we should ! Documented or not, they worth it !
Gedeon

Re: Repeat command

Post by Gedeon »

Be carefull whith loop commands, if you don't have pause in this sequence, the CPU time may be used at 100%.

A loop like : while true; do :; done ==> 100% and very difficult to stop this by ctrl-c.
You must use pause with sleep N (N can be < 1 like 0.2).

G
Eliott_DUP

Re: Repeat command

Post by Eliott_DUP »

Yes,
that's why I put it in my postings :wink:
Eliott wrote:while : ; do
command
sleep 5
done

:lol:

or
watch -n -d1
or
at
or
cfgCron
Eliott wrote:do ?

for((i=0;$i<=5;i=$(($i+1))))do config 0;usleep 500000; done
Only-Alcatel

Re: Repeat command

Post by Only-Alcatel »

just push the 'up' arrow on your keyboard and you can scroll back through all the entries made at the prompt......................?
User avatar
Eliott
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 640
Joined: 10 Feb 2010 03:43

Re: Repeat command

Post by Eliott »

Only-Alcatel wrote:just push the 'up' arrow on your keyboard and you can scroll back through all the entries made at the prompt......................?
This will not repeat the command continously. It will just allow you to get a list of the last commands to execute it again - but manually.
You can also use the history command and execute a specific command using ! followed by the number.
And Ctrl+r can search a part of the last entered commands.
Post Reply

Return to “Usefull commands”