Pages : 1
#1 Le 16/02/2015, à 19:52
- sidalilou2
CTRL C in scripting shell
Dear,
How can bash script do the equivalent of (Ctrl C) ?
regards,
Hors ligne
#2 Le 17/02/2015, à 08:47
- serged
Re : CTRL C in scripting shell
kill ?
LinuxMint Vera Cinnamon et d'autres machines en MATE, XFCE... 20.x , 21.x ou 19.x
Tour : Asus F2A55 / AMD A8-5600K APU 3,6GHz / RAM 16Go / Nvidia GeForce GT610 / LM21.1 Cinnamon
Portable : LDLC Mercure MH : Celeron N3450 /RAM 4Go / Intel HD graphics 500 i915 / biboot Win 10 (sur SSD) - LM21.1 MATE (sur HDD)
Hors ligne
#3 Le 17/02/2015, à 16:37
- sidalilou2
Re : CTRL C in scripting shell
i use kill but the same issue :
var='sed -n 1p test.txt' // var = Process id =54311
kill -2 $var
for example: when we execute top and i want to stop it , we do (ctrl c) to stop it.
but in the script it's not stoped using kill :
simple script
#!/bin/bash
top
rm -f test.txt
ps -ef | grep top | awk '{ print $2 }' >> test.txt
var='sed -n 1p test.txt'
kill -2 $var
i want to stop top execution when we launch script.
Thank's in advance
Dernière modification par sidalilou2 (Le 17/02/2015, à 16:47)
Hors ligne