![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" | iBot | UNIX and Linux RSS News | 0 | 01-04-2008 11:00 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 09:52 PM |
| how could i make a program mixed with many "|", "<" and ">" | strugglingman | High Level Programming | 2 | 04-29-2006 05:11 AM |
| No utpmx entry: you must exec "login" from lowest level "shell" | peterpan | UNIX for Dummies Questions & Answers | 0 | 01-18-2006 12:15 AM |
| My "Bread and Butter" Process Keep Alive Perl Script.... | Neo | Tips and Tutorials | 0 | 01-08-2005 01:17 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Pid still alive after "control C"
hi ,
i'm running 2 similar script (ksh) under AIX , the first go normally out when i type "control c" : ps before : notes01 19882 38990 0 11:54:48 pts/0 0:00 recover -s cla0bkpe -d /base/base01 -t May 05 23:02:17 2005 -v -f -a /base/base01/mail/mail-01/xxxx.nsf notes01 30866 40880 0 11:53:24 pts/0 0:00 -ksh notes01 38990 30866 0 11:53:55 pts/0 0:00 ksh /exploit/sun/notes/notes-recover ps after => nothing and the pid is killed when the 2nd got his pid alive : ps before : notes02 21492 49230 0 13:47:40 pts/0 0:00 nsrnotesrc -s pcyyesvg -ZZ -X -t May 03 23:00:26 2005 -d /base/base02 /base/base02/mail/mail-01/xxxx.nsf notes02 39506 42214 0 11:20:11 pts/0 0:00 -ksh notes02 49230 39506 1 13:47:11 pts/0 0:00 ksh /users/notes02/scripts/sad/util/notes_restaure.ksh ps after : notes02 21492 1 0 13:47:40 pts/0 0:00 nsrnotesrc -s pcyyesvg -ZZ -X -t May 03 23:00:26 2005 -d /base/base02 /base/base02/mail/mail-01/xxx.nsf the first script extract: .............. recover -s ${NWServ} -d ${Directory} -t "${NewDate}" -v -f -a ${Fichier} >> ${LOG} 2>&1 & Pid=$! x=0 while : do ps -u ${IDUSER} | grep -q "${Pid}" [[ $? -ne 0 ]] && break Result=$(ls -al ${Directory}/$(basename ${Fichier}) 2> /dev/null | awk '{print $5;}') Result=$((${Result}*100/${Size})) x=${x}+1 Sigle=$(print $((${x}%4+1)) | awk '{print substr("|/-\\",$1,1);}') [[ ${TTY} -eq 0 ]] && (tput sc;printf "%s %s %%" ${Sigle} ${Result};tput rc) sleep 1 done .............. the second script extract: ............. nsrnotesrc -s ${NWServ} -ZZ -X -t "${NewDate}" -d ${Directory} ${Fichier} >> ${LOG} 2>&1 & Pid=$! echo " PID" echo $Pid echo "" x=0 while : do ps -u ${IDUSER} | grep -q "${Pid}" [[ $? -ne 0 ]] && break Result=$(ls -al ${Directory}${Fichier} 2> /dev/null | awk '{print $5;}') Result=$((${Result}*100/${Size})) x=${x}+1 Sigle=$(print $((${x}%4+1)) | awk '{print substr("|/-\\",$1,1);}') [[ ${TTY} -eq 0 ]] && (tput sc;printf "%s %s %%" ${Sigle} ${Result};tput rc) sleep 1 done .......... Why in the second one , the script go out and the pid attached to the "1" father ? Where is the mistake ? thanks in advance Christian |
| Forum Sponsor | ||
|
|