05-20-2008
How can debug our UNIX shell script?
Hi all,
i have two simple questions here...
1. i want to know that how to debug the UNIX shell script?
2. is there any way to handling the exception in UNIX shell script like oracle exception handling?
Please provide me those details it would be great help/
Thanks and Regards,
MPS
Bangalore
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
The following C++ code segment is not working in debug mode build on HP-UNIX machine. It is not printing "Hello World" message on the screen. While it is working fine in release mode build.
==============================================
class KLogStreamBuf : public streambuf {
public:... (0 Replies)
Discussion started by: heena
0 Replies
2. Shell Programming and Scripting
echo "input time in hhmmss"
read $st
h=`echo $st | cut -c1-2`
min=`echo $st | cut -c3-4`
s=`echo $st | cut -c5-6`
echo "input time in hhmmss"
read $end
h1=`echo $end | cut -c1-2`
min1=`echo $end | cut -c3-4`
s1=`echo $end | cut -c5-6`
x= `expr $h /* 60 + $min`
y= `expr $h1 /* 60 +... (8 Replies)
Discussion started by: abhishek27
8 Replies
3. Shell Programming and Scripting
Hi Buddies,
The following is shell scripts which was borrowed from linux box for load average check. it runs good.
(this structure is simple, when load average is too high, it will send alert to user)
#!/usr/bin/ksh
# Set threshold for 1, 5 and 15 minture load avarage
# configured for... (4 Replies)
Discussion started by: GreatJerry
4 Replies
4. Shell Programming and Scripting
Hi,
I have this script, searches and sets variables, then searches and sets more variables from multiple files.
I'd need to debug it a bit.
#!/bin/bash
egrep $1 `find | grep MAGT` >/tmp/resRA-$$
thread=`sed -n '/{0x/ {s/^.*{0x\(*\).*/\1/p;q}' /tmp/resRA-$$`
tag=`sed -n '/Tag=/... (5 Replies)
Discussion started by: Vitoriung
5 Replies
5. Shell Programming and Scripting
Hi I am relatively new in shell scripting Below is the code which i developed but for some reason, it keeps giving me error:
/apps/bss/BatchProg/at1/batch/scripts/ksh/TBATLC02.ksh: syntax error at line 41 : `then' unmatched
#!/usr/bin/ksh... (4 Replies)
Discussion started by: scripting_newbe
4 Replies
6. Shell Programming and Scripting
I know about bash -x, set -x and -v but disappears from Command Line Interface in fraction of second ......
I am looking for a command or script ..complies each line and shows the output after executing each line ....( similar what we have in C )
Thanks in Advance (2 Replies)
Discussion started by: frintocf
2 Replies
7. Shell Programming and Scripting
I have a shell program which calls a perl program.
I am running the shell program with command;
$ ksh -x <prog_name>
Inside the shell program, I am calling perl with warnings.
I want to capture the entire output as it comes on screen.
The command I tried is:
$ ksh -x... (1 Reply)
Discussion started by: som.nitk
1 Replies
8. Ubuntu
How can I debug this script?
I want to know what it is doing or not doing?
#!/bin/bash
#
#
if ; then
# Do the thing you want before suspend here
echo "we are suspending." > /tmp/systemd_suspend_test.txt
elif ; then
# Do the thing you want after resume here
echo "and we are... (21 Replies)
Discussion started by: drew77
21 Replies
9. UNIX for Beginners Questions & Answers
Hello All,
I have got a section of shell script which was working earlier but now it is giving some different results:
MSG=
while true
do
themenu
getchar =
case $answer in
1) export_Config_tables;;
2) export_config_tables_file;;
3)... (1 Reply)
Discussion started by: bghosh
1 Replies
LEARN ABOUT OSF1
mkmanifest
mkmanifest(1) General Commands Manual mkmanifest(1)
NAME
mkmanifest - mtools utility to create a shell script to restore UNIX file names from DOS
SYNOPSIS
mkmanifest [files]
OPTIONS
None
OPERANDS
A list of UNIX file names to be converted to DOS name format.
DESCRIPTION
The mkmanifest command creates a shell script that aids in the restore of UNIX file names that were overwritten by DOS file name restric-
tions. DOS file names are uppercase only, cannot exceed 8 character names, 3 character extensions and do not support device names or non-
alphanumeric characters.
Not all UNIX file names are supported in the DOS world. The mtools commands may have to change UNIX names to fit the DOS file name conven-
tions. Most commands provide the verbose option (-v), that displays new file names if they have been changed. The following table shows
some examples of file name conversions:
-----------------------------------------------
UNIX name DOS name Reason for the change
-----------------------------------------------
thisisatest THISISAT file name too long
file.stuff FILE.STU extension too long
prn.txt XRN.TXT PRN is a device name
.abc X.ABC null file name
hot+cold HOTXCOLD illegal character
-----------------------------------------------
EXIT STATUS
The following exit values are returned: Success. Failure.
EXAMPLES
Assume you have the following UNIX files that you want to copy to a DOS diskette using the mcopy command.
very_long_name 2.many.dots illegal: good.c prn.dev Capital
The mcopy command converts these file names to the following:
very_lon 2xmany.dot illegalx good.c xprn.dev capital
To restore the previous file names, use the mkmanifest command as follows: mkmanifest very_long_name 2.many.dots illegal:
good.c prn.dev Capital > manifest
The previous mkmanifest command line produces the following: mv very_lon very_long_name mv 2xmany.dot 2.many.dots mv illegalx illegal: mv
xprn.dev prn.dev mv capital Capital
The good.c file name did not require conversion, hence it was not included in the output.
If these files were copied from diskette to another UNIX system, and you wanted to restore the original names, retain a copy of the mani-
fest file (captured output) so that it can be used to convert the file names again.
FILES
Executable file
SEE ALSO
Commands: mcopy(1), mtools(1)
mkmanifest(1)