I spent last few days porting ksh script from ksh88/SunOS to ksh93/Linux. Basically, things are going well and I do not have too much troubles porting ks88 script to ksh93, but I stuck on one item. It's about sending and handling the signal. I found two similar topics on this forum, but hints provided there, do not resolve my problem (
Run the script and hold on read instruction (do not put any data). Now, from other terminal, send USR1 signal to this script. Please note, ksh88/SunOS and ksh93/Linux behave different way here.
# ksh88/SunOS” [OUTPUT] put some text here.... my pid is 11325
got a signal! I'm done [/OUTPUT]
# ksh93/Linux # [OUTPUT] put some text here.... my pid is 29688 got a signal!
# It still sits in read instruction. You need to hit entrer to continue. [/OUTPUT]
I was expecting ksh handling the signal this way: 1. break current system call (read instrluction in this case) 2. execute trap instructions 3. continue with next instruction after the read.
This flow work on the SunOS/ksh88. Read instruction is interrupted, but not with ksh93/Linux. With ksh93/Linux I'm not able to break read instruction using signal and that's my concern here.
Please note, I can not use “-t” option for read, since my script must be backward compatible with ksh88. I either can't use “line” command, since it's not available on my linux machine. I would appreciate any hint/suggestions how to break read instruction. Kind Regards, bzk
I have a process to terminate, and when keying Control C/ kill -int , it takes 15 minutes to half an hour to terminate the process. I've tried using kill -2, or keying control c twice, however the process seem
to be killed abruptly, without writing into the log file.
So the only way in order to... (8 Replies)
any idea on how to timeout the read statement for ksh?
for bash u can use read -t option
-t timeout
Cause read to time out and return failure if a complete
line of input is not read within timeout seconds. This
option has ... (2 Replies)
Hi All,
Is there any way to read the previous line in file reading ?
or
is there any way to read a line twice in KSH ?
thanks in advance !!
Srini (6 Replies)
I am stuck with a problem while reading data from a file..
while
do
read line
#do some operations and if some condition is satisfied, ask the user to enter his choice.
# using the choice continue operations.
done < fileBeingRead.txt
The... (4 Replies)
hello everyone,
I'm having a problem doing signal handling so I post this thread to see if I could get help.
I want asynchronous signal handling, that means when I'm processing a signal (signal 1), if the same signal comes (signal 2) that signal (signal 2) shall be processed; and moreover,... (7 Replies)
hi,
I'm a newbie to shell scripting. I wanted to initialise an array using basic for loop and read it.
Then i want to print it as a .CSV file..
Any help would me much appreciated.. (1 Reply)
I receive the following warning messages on a very new machine which has FreeBSD 8.1 x64 installed on it:
Interrupt storm detected on "irq 20" throttling interrupt source
It is unclear what this means and what its origins are (motherboard? CPU? RAM?).
I can start the desktop and the message is... (4 Replies)
Hello,
I have used a chunk of ksh script similar to this in many places without any issue:
while :
do
print;
read OPTION?"Enter a number (q to quit): "
expr ${OPTION} + 1 >/dev/null 2>&1
CHECKVAL=$?
if }" != ${OPTION} ]; then
... (2 Replies)
Greetings. This is my first post in this forum; I hope y'all find it useful. One caveat: "Concise" is my middle name. NOT! :D
I am almost done with a shell script that runs as a daemon. It monitors a message log that is frequently written to by a database server but it it works my client will... (2 Replies)