You should start debugging it step by step yourself. As a start the first errors you get with grep, it seems that there is missing either the pattern or the file. Add a set -x in the previous line of the first grep in your code and check, which of them is incomplete/has a wrong syntax. You can turn off that debugging with set +x.
Its been a null output in the previous script, Dint see any such kind of errors. But i slightly modified the script and popped up with some errors. I'm seeing the functions are not getting executed properly, instead errors were found.
Zaxxon,
I set the script to run into debug mode, but Im unable to trace the real errors .
Having special characters in a multi-line echo in function usage(), you should put in some more echoes and escape them all by surrounding the lines with " in the front and the end:
Use something like:
This as a first step, then check out what is not working next.
Last edited by zaxxon; 05-12-2011 at 09:47 AM..
Reason: typo and adding a sentence
This "if" test is misplaced, syntactically incorrect and upsetting the whole structure of the script.
Quote:
if [ $# != 2 ] then
usage() {
You probably meant to declare the function "usage" first, then later in the script ....
There are more typos in the script, some of which matter (like "Case" instead of "case") and some less important like the spelling of "successful"!
As others suggest, work you way through the script correcting each error. As this strikes me as an edit to a complex script perhaps introduce the changes bit-by-bit and test at every stage.
Quote:
LOG_NAME_DATE=`date +%y%m%d% -%H%M%S`
This does not produce what you think. Even after removing the space character there is an extra % character. Try it?
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)
Hello, I was looking at kernel log's and found some parts what was "interesting"
I previously started looking what has been going on in my computer because I had hacker attacks on my machine.
Installed Avira & Little Snitch - softwares
Previously my computer opened few folders what I have... (1 Reply)
Can you help please ?
./get_df.sh: syntax error at line 13 : `then' unexpected
#!/bin/ksh
while :
do
PER=`df -h /DATA/ | nawk '{if (NR != 1) { sub (/%/,""); print $(NF-1)}}'`
if
then
if]
then
mailx -s "FS over 90 per" me@company.com
touch... (2 Replies)
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)
When I run a lengthy script in debug mode i need to capture all the steps which are executed.
e.g
ksh -x script.ksh
+ test -f /proc/mounts
+ /bin/ls -l /proc/21326/exe
+ is=ksh
+ test ksh = ksh
+ test -s /etc/ksh.kshrc
+ . /etc/ksh.kshrc
+ trap 1 2 3
+ who am i
+ awk {print $1}
+... (2 Replies)
Hi,
In our program, we are using SIGTERM and i tired to put break point in this function. But my debuger is unable to brake at that point.
I am working on Mac X and using XCode.
Thanks (1 Reply)
Hi,
In our program, we are using SIGTERM and i tired to put break point in this function. But my debuger is unable to brake at that point.
I am working on Mac X and using XCode.
Thanks (0 Replies)
i am new to solaris
i have one module which contain certain header files and sub modules
i want ot execute the module and c what the values are beeing assigned to variables
is makefile only solution for this
is there any editor to help it,so that i can c the flow of the program and also... (1 Reply)