i was going through the script debugging technique. below example was given in the book.
my problem is when author debug the script with -nv option he is getting below o/p
however when i debug the same script with same option i am getting below o/p
in my case i just change the name of the script.(i use debug6 and author used buggy2.sh rest i simply copy paste the script.)
why here i am getting bit more info in compare to author's o/p. is there is some problem or it is ok.
to correct the script author suggested to put (; ; after Failed in line no. 20 like below.
my question is why i need to use 2 colon after Failed not one?
also how does author know just by seeing one single line(means by seeing o/p of debug) that he need to put 2 colon after Failed.
Sure it is working, it is just that it is wrong. Whatever you input, it will be interpreted as "yes".
Your first question I answered.
The author sees that the shell is not expecting to see a ")" character and the author concludes that this is due to the fact that the previous part was not closed with ;;, which is a matter of syntax.
Because that's the syntax for terminating a block of case statements. The first semi-colon ends that particular statement and the second ends the whole case block. The second one ensures that you don't try the following case blocks.
It is also possible to try the following block/s if you replace the second semi-colon with an ampersand (I think that's called a fall-through).
produces
I have this code
#!/bin/bash
LZ () {
RETVAL="\n$(date +%Y-%m-%d_%H-%M-%S) --- "
return RETVAL
}
echo -e $LZ"Test"
sleep 3
echo -e $LZ"Test"
which I want to use to make logentrys on my NAS. I expect of this code that there would be output like
2017-03-07_11-00-00 --- Test (4 Replies)
Hi ,
could someone suggest best reference for core file understanding , analysis , debugging for different architectures
like what registers represent what in a architecture specific core ..
how to get maximum information out of corrupted core
different tools and how they work and how to... (1 Reply)
the attached perl script is a deamon that, once kicked off from the command line, it runs in the background and waits for the master server to tell it what plugins to run.
the script works well. but the problem is, whenever i start it, after about a few seconds of starting it, i start getting... (4 Replies)
I have added some code in my file.
I have created executable rpm file of our code and also I have created debuginfo and debugsource files and installed all three.
But when I debug in gdb I see the the code changes in soucre file. But the break point does not hit at that place as if it did not... (1 Reply)
i am beginner in shell scripting.
not able to understand what below line will do.
PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST
below is the script
#!/bin/hash
PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST ;
echo $PS1
and i getting the below output
Žuname -nŽ$ (25 Replies)
If I don't explain my issue well enough, I apologize ahead of time, extreme newbie here to scripting.
I'm currently learning scripting from books and have moved on to the text Wicked Cool Shell Scripts by Dave Taylor, but there are still basic concepts that I'm having trouble understanding.
... (10 Replies)
OS : SOLARIS 10
debug tool :$gdb -v
GNU gdb 6.6
compiler : $gcc -v
gcc version 2.95.3 20010315 (release)
When i tried to debug my application i got the following error.
$gdb Pal
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
This GDB was... (2 Replies)
Hi,
Can anyone please let me know the meaning of this line,i am not able to understand the egrep part(egrep '^{1,2}).This will search for this combination in beginning but what does the values in {}signifies here.
/bin/echo $WhenToRun | egrep '^{1,2}:$' >/dev/null (1 Reply)