×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Ctrl-C likes to hang in ksh

Ctrl-C likes to hang in ksh

Ctrl-C likes to hang in ksh

(OP)
I have this strange problem. It started simple enough. The problem was Ctrl-C would not exit a tail -f. Here is the full command I ran when this happened.

ls -l | tail +3 | cut -c55- | sort | uniq -c; tail -f a.log

When I hit Ctrl-C, only ^c would be printed out to my screen but I was not taken back to the prompt. So I disconnected from my session and logged back in. I ran stty -a to check the intr which was set to ^c. I was able to change the intr to Ctrl-H which also did not cancel the tail -f. Ctrl works when I run the tail -f alone with no command in front of it and it also works if I shorten the command to:

ls -l | tail +3 | cut -c55- | sort; tail -f a.log

Now, I understand I can simply just hit return before I run a tail -f so this problem is not critical but this does perplex me a little.

This does not happen in csh or bash, only when I'm using ksh. This also does not happen on every UNIX box I'm on. This only happens on three as far as I can tell out of 20 or so.

I can place the lines in a short shell script and it works fine. For example: script; tail -f a.log

I have tried telnet, rlogin, and netterm. They all gave the same results. I also replace tail -f with sleep 20 and that didn't make a difference either.

Does anyone know if this is a small bug in ksh or has any other ideas why this might be happening?

Thanks,

Kev

RE: Ctrl-C likes to hang in ksh

(OP)
Forgot to add to my previous post. We use Solaris 7.

Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources