How to stop debug in the mid of process?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to stop debug in the mid of process?
# 8  
Old 11-07-2013
ken6503

An excellent hint to step through scripts. I shall deploy it in scripts something like this:-
Code:
#!/bin/ksh
# Comments....
#

if [ ! -z "$DEBUGSTEP" ]
then
   set -x
   trap "read" DEBUG
fi
echo 1
echo 2
echo 3

In normal use, DEBUGSTEP will be null and therefore no action is taken, but when required I can step through a script and debug without updating the production script or any calling script.


Marvellous!


Thanks again,
Robin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash Question: HowTo Exit Script with User Input While Process is Running Mid-Loop?

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)
Discussion started by: hilltop_yodeler
9 Replies

2. Shell Programming and Scripting

How to stop the process in shell scripting?

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)
Discussion started by: aish11
5 Replies

3. UNIX for Dummies Questions & Answers

Stop the process

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)
Discussion started by: bobby1015
3 Replies

4. Shell Programming and Scripting

Process running? Stop it

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)
Discussion started by: LukasB
4 Replies

5. Shell Programming and Scripting

how to stop the process that is running continously

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)
Discussion started by: NehaKrish
3 Replies

6. Programming

Debug two process Using GDB

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)
Discussion started by: mr_deb
2 Replies

7. AIX

a process that never stop

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)
Discussion started by: TheEngineer
13 Replies

8. Shell Programming and Scripting

Stop / kill the process individually

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)
Discussion started by: braindrain
5 Replies
Login or Register to Ask a Question
RADDEBUG(8)							 FreeRADIUS Daemon						       RADDEBUG(8)

NAME
raddebug - Display debugging output from a running server. SYNOPSIS
raddebug [-c condition] [-d config_directory] [-i ipv4-address] [-I ipv6-address] [-f socket_file] [-t timeout] [-u user-name] DESCRIPTION
raddebug is a shell script wrapper around radmin that automates the process of obtaining debugging output from a running server. It does this without impacting service availability, unlike using radiusd -X. There are a number of prerequisites that are required for its proper operation: * radmin must be available in the PATH. * The user running raddebug must have permission to connect to the server control socket. * The control socket must be configured. For instructions, see raddb/sites-available/control-socket * The control socket must be marked as "mode = rw". * The user running raddebug must have permission to read and write files in the "logdir" directory. This is usually /var/log/radiusd. For a number of reasons, the debugging output is placed in an intermediate file, rather than being sent directly to standard output. In order to prevent this file from growing too large, the raddebug program is automatically terminated after 10 seconds. This timeout can be changed via the "-t" parameter. When the script exits, debug mode in the server is disabled, and the intermediate file is deleted. Debug output from a live server can be redirected to only one location. If a second instance of raddebug is started while the first one is still running, the later one will over-ride the first one, and the first will stop producing output. OPTIONS
-c condition Set a specific debug condition. The format of the condition is as specified in the CONDITIONS section of the unlang manual page. -f socket_file The path to the control socket. See the radmin manual page for more description of this option. -i ipv4-address Show debug output for the client having the given IPv4 address. This option is equivalent to using: -c '(Packet-Src-IP-Address == ipv4-address)' -d config directory The radius configuration directory, usually /etc/raddb. See the radmin manual page for more description of this option. -I ipv6-address Show debug output for the client having the given IPv6 address. This option is equivalent to using: -c '(Packet-Src-IPv6-Address == ipv6-address)' -t timeout Stop printing debug output after "timeout" seconds. The default timeout is sixty (60) seconds. Use "-t 0" to print debugging out- put forever, or until the script exits. -u name Show debug output for users having the given name. This option is equivalent to using: -c '(User-Name == name)' SEE ALSO
radmin(8), raddb/sites-available/control-socket, unlang(5), radiusd.conf(5) AUTHORS
Alan DeKok <aland@freeradius.org> 1 September 2010 RADDEBUG(8)