1834436 Members
2311 Online
110067 Solutions
New Discussion

break process

 
SOLVED
Go to solution
juno2
Super Advisor

break process

when I use the command "ls" to list out a large number of files , I can't use the "Ctrl + C or Ctrl + break" to break the process when it is listing the files , can suggest when is the problem in my system ? thx
8 REPLIES 8
Michael Tully
Honored Contributor
Solution

Re: break process

There is nothing wrong with your system. When listing a large number of files, it takes longer to display them to the 'tty' (your terminal) than to run the command. Your best bet is to run them with wildcards, or output the result to a file.

# ls a*
# ls >/tmp/file.out

You should also look at assigning points to peoples responses. They assist you using their own time and resources. Your record of 0 assignments from 106 responses is not good.
See here:
http://forums.itrc.hp.com/cm/UserProfile/1,,CA908664!1,00.html
Anyone for a Mutiny ?
T G Manikandan
Honored Contributor

Re: break process

check for

#stty -a

you should have


intr=^C(interrupt)

#stty intr ^C(crtl v +crtl c)


Thanks
T G Manikandan
Honored Contributor
juno2
Super Advisor

Re: break process

This is the output of
#stty -a
stty -a
speed 9600 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ;
eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke,

but still can't use the " ctrl + C " , what is problem in our system ? thx.
T G Manikandan
Honored Contributor

Re: break process

I think this should work

For example
you do a
ls -Rl from the / dir.

Then do a crtl-c.

The system should take some time to receive the interrupt and stop processing.


juno2
Super Advisor

Re: break process

Hi TG,

I tried your method , but still not work.
Frank Slootweg
Honored Contributor

Re: break process

First try something *else* to see whether or not Ctrl+C works, i.e.

$ sleep 100
[You should get no prompt because the sleep waits for 100 seconds.]
[Now type:]
Ctrl+C
[I.e. Press and hold the Ctrl key, press the C key and release both. You now should get the prompt.]

Looking at your reported "stty -a" settings, Ctrl+break will probably not work.

However Ctrl+\ ("quit" signal) should work, and should say "Quit(coredump)" and should generate a core file (file "core" in the current directory).
Ernesto Cappello
Trusted Contributor

Re: break process

Hi,
type "stty -a" in your shell prompt:

speed 9600 baud; line = 0;
rows = 51; columns = 88
min = 4; time = 12;
intr = ^C; quit = ^X; erase = ^H; kill = ^U
eof = ^D; eol = ^L; eol2 = ^@; swtch = ^@
stop = ^S; start = ^Q; susp = ^Z; dsusp = ^Y
werase = ^@; lnext = ^@
parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop

if it doesn't work, execute this script:

export TERM=xterm
export PATH=$HOME/local/bin:$PATH
stty kill '^U' intr '^C' quit '^X' eol '^L' erase '^H'
tset
export DISPLAY="nomepc":0.0

Regards.
Ernesto.