I am debugging a script. it loops filelist. since the list a very long. when debugging, I only can see the last a few lines. is there any way to stop debuger in the mid of process.
the command I used for debugging is:
Thanks in advance
Not really with invoking it that way. Perhaps you would be better to capture the output to a file and then view that later on:-
If you need to interact with it, you could do the following:-
Note the append to log >> in this case.
You can also select the lines in a script that you want to trace. The command:
turns tracing on for following commands in the script, and the command:
turns tracing off for following commands.
Don has it - as always - right: instead of tracing the script wholesale you should trace one (small) piece after the other. Set pairs of set -xv and set +xv and move these pairs around while debugging.
Another thing is: debugging output happens on <stderr> and you can catch this output and display it pagewise:
My favourite is yet to (mostly) skip tracing altogether. In most cases you can put in some diagnostic messages into your script. Suppose you have the following:
Instead of decorating such a loop with "set +/- xv" you could also build in a diagnostic message and let it run:
Now you will get pairs of before- and after-values and can probably find the culprit. Maybe there is another component involved, so output that too with each pass of the loop. You get the idea.
Once you found and corrected the problem you remove these lines again and start working on the next bug the same way.
Another possibility is to display commands instead of executing them. Replace any:
with
You can decorate several interesting commands like that. If you set DEBUG to "echo" they are not executed but displayed like they would be executed, quite similar to what you see with "set -x". Set DEBUG to "" and they are executed normally again. This way you can switch between debugging runs and normal runs easily.
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Hi all,
I have tried the below code to execute.
#! /bin/bash
date1=`date -d "today 08:00:00" +%s`
date2=`date -d "today 08:01:00" +%s`
path=/home/user01/red/IDC/sample
cd $path
java Cspsamp 111.19.5.172 7025 rd1 rd1 "5022=Query|5026=109378|4=627|5=E:VD|5042=$date1|5049=$date2"... (5 Replies)
I have the following log file running since yesterday and its consuming so much of the disk space.
-rw-rw-r-- 1 dev dba 4543237120 Nov 10 09:00 load_run_file1_0.1111091224.lg
How do i kill this process. I don't have any idea of stopping this. Any help would be really appreciated.
... (3 Replies)
I have this "process keepalive" script:
#!/bin/bash
PIDFILE=/tmp/php.pid
PHPSCRIPT=/home/www/mydomain.com/subdomains/www/parser.php
echo 'Checking php process from PID file'
if ; then
PID=`cat $PIDFILE`
if ps ax | grep -v grep | grep $PID > /dev/null
then
echo "php process still... (4 Replies)
Hi there,
I have written a script to check daily process,
each script is in a different directory.
Now the first process is running fine, when it goes to the next directory the process doesn't executes.
cd result/logs
ref=month_1888.log
echo $ref>> $logfile
cd /max/tot/first... (3 Replies)
Hi All
I know How to attach a process to beubg it .But for my application I am using client as well server.Both are two separate process .Suppose I need to debug both .How to attach both of them together .Or I have to attach them separetly .
Suppose client process id is 1325 and server is... (2 Replies)
Dears all
i have an AIX box in which i am facing a problem with a process as below:
/usr/dt/bin/dtexec -open 0 -ttprocid
and each time i am killing this process with "kill -9" then it run again after a while.
any ideas or solutions will be appreciated. (13 Replies)
Hi ,
I have a situation, where I have 10 indivudal processess started by similar instance.I say similar instance because each of them being started as a new thread:
Say I've following unix process running
process1_ADAP
process2_ADAP
process3_ADAP
Current scenario:
Now I have SHUTDOWN... (5 Replies)