08-02-2005
On the beginning of your script :
#!/bin/ksh
set -x
exec 2>/tmp/${0}.log
Rgds.
10 More Discussions You Might Find Interesting
1. AIX
How to debug a shared library(.so file) on AIX? (1 Reply)
Discussion started by: AlbertGao
1 Replies
2. Shell Programming and Scripting
I have this in my script:
DEBUG_DIR=/log/rotate_output
DEBUGLOG=${DEBUG_DIR}/rotate.${TIMESTAMP}
SERVER_FILE_LIST="\
wasint0206 /logs/squid_backup
wasint0201 /logs/squid_backup"
/usr/bin/echo "${SERVER_FILE_LIST}" | while read SERVER DIRECTORY
do
cd /log/squid_logs/${SERVER}... (2 Replies)
Discussion started by: LordJezo
2 Replies
3. UNIX for Dummies Questions & Answers
I'm trying to debug a script in korn shell
At the begining of the script I've got
#!/bin/ksh -vx
However, this seems to only dump debugging info to the screen. How do I get that sent to a text file? I've tried various redirects but none of them seem to work.
Thanks (2 Replies)
Discussion started by: Ant1815
2 Replies
4. Programming
I created one file (test.cpp)and complied it and get the executable file(test) and run it.It is giving the out put but when I am trying to debug that executable.I am getting the error --
please tell me the solutions??
Thanks in advance ..... (2 Replies)
Discussion started by: smartgupta
2 Replies
5. Shell Programming and Scripting
:confused: I have a ksh script which gathers data from a file. I need to find a way to direct the output to a new file. The code looks something like this:
DUP_FILE=`touch /export/.../.../dup_social_$1`
while (($# > 0 ))
do
# Make sure the file exists
if ]
then
print "$1: does not... (4 Replies)
Discussion started by: Muga801
4 Replies
6. Programming
Hi,
I'm using the following commands to execute a proc file, but I'm unable to debug the program. What modifications do I need to make in the command options to debug the program created.
I have a proc1.pc file, using the following three steps to generate the proc1 exe. After the proc1 exe... (2 Replies)
Discussion started by: ehari
2 Replies
7. Solaris
Hi All,
I have a question on debugging the .so file.
When I am running makefile I am getting a .so file and we are using that .so file for executing our code.But I want to know
1.Can I use dbx or gdb to debug a .so file?
2.How can i generate .out file so that i can use that in dbx or gdb... (1 Reply)
Discussion started by: s.sen1213
1 Replies
8. Red Hat
I am running clive on Linux version 2.6.24.5-85.fc8 (Red Hat 4.1.2-33) with the debug command as follows
clive --debug -O <logfile> http://www.youtube.com/watch?v....
I need to get the contents of the debug written to file to extract data later. Using the -O option actually writes the... (0 Replies)
Discussion started by: rob171171
0 Replies
9. Shell Programming and Scripting
I'm trying to run the logic below but get a `<' is not matched error message when I return a Y or y;
printf "Run this ? : "
read RESP
case $RESP in
Y|y)
cat <<EOF > file
today is Monday
EOF ;;
N|n)
exit 1 ;;
esac
Any ideas? (2 Replies)
Discussion started by: h8mmer
2 Replies
10. Shell Programming and Scripting
I want to capture the debug for the below command in output file .
i tried like this but its not working:
sh -xv <scriptname> >> output.log
i want the output in a log file.
Anyone plz help in this (2 Replies)
Discussion started by: chakkaravarthy
2 Replies
exec(1) User Commands exec(1)
NAME
exec, eval, source - shell built-in functions to execute other commands
SYNOPSIS
sh
exec [argument...]
eval [argument...]
csh
exec command
eval argument...
source [-h] name
ksh
*exec [arg...]
*eval [arg...]
DESCRIPTION
sh
The exec command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments may
appear and, if no other arguments are given, cause the shell input/output to be modified.
The arguments to the eval built-in are read as input to the shell and the resulting command(s) executed.
csh
exec executes command in place of the current shell, which terminates.
eval reads its arguments as input to the shell and executes the resulting command(s). This is usually used to execute commands generated as
the result of command or variable substitution.
source reads commands from name. source commands may be nested, but if they are nested too deeply the shell may run out of file descrip-
tors. An error in a sourced file at any level terminates all nested source commands.
-h Place commands from the file name on the history list without executing them.
ksh
With the exec built-in, if arg is given, the command specified by the arguments is executed in place of this shell without creating a new
process. Input/output arguments may appear and affect the current process. If no arguments are given the effect of this command is to mod-
ify file descriptors as prescribed by the input/output redirection list. In this case, any file descriptor numbers greater than 2 that are
opened with this mechanism are closed when invoking another program.
The arguments to eval are read as input to the shell and the resulting command(s) executed.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
EXIT STATUS
For ksh:
If command is not found, the exit status is 127. If command is found, but is not an executable utility, the exit status is 126. If a redi-
rection error occurs, the shell exits with a value in the range 1-125. Otherwise, exec returns a zero exit status.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), ksh(1), sh(1), attributes(5)
SunOS 5.10 17 Jul 2002 exec(1)