03-30-2009
You should at least test the code with the fall-through condition added and see if that gets the script to run without reporting the warning (its not an error) about the unintialized variable. If it does not get rid of the warning you will know my suggestion is wrong, but if it does then your assumption of what is causing the warning could be wrong. And please note, it is a warning, not an error. Sometimes variables do have the chance of being uniitialized, which is why a default or fall-through condition is almost always a good idea.
Also, writing neat and readable code during constructions is very important, that is no excuse for writing sloppy code. Slopy code always makes tracking down bugs much harder than it should be. Its very good though that you are using "strict" and I assume "warnings".
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Assuming the following code
sub foo {
dosomething {...}
else { foo }
is the number of times foo has been called kept track of internally and how could I access that count? (1 Reply)
Discussion started by: thumper
1 Replies
2. Shell Programming and Scripting
can I call a function in bash script just as in C++
while
do
function()
done
function()
thanks,
Steffen (3 Replies)
Discussion started by: forever_49ers
3 Replies
3. Shell Programming and Scripting
Hello people,
Need help !!! What am I doing wrong here ?
I am writing a function to recursively list the files under a folder and it's sub-folders. Problem is once it list the files under the innermost folder, it terminates. What do I need to do so that it returns and list files under the... (3 Replies)
Discussion started by: tipsy
3 Replies
4. Programming
Hi, Can anyone help me figure out the problem I'm having with a function call?
I have a header file, which sets an enum:
typedef enum {INFO, WARNING, FATAL} Levels;
int log_event (Levels, char *fmt, ...);
..then the function is called this way:
log_event(INFO, "Message text");
... (6 Replies)
Discussion started by: Stevhp
6 Replies
5. Shell Programming and Scripting
I have a function check_ok in my abc.sh. which return me 1 or 0 . I want to call this fuction through other shell script. this shell also send two parameter to calling function.
Can you please tell me how. I am very new in unix.
#!/bin/bash
date_equal()
{
sqlplus -silent... (4 Replies)
Discussion started by: Jamil Qadir
4 Replies
6. Shell Programming and Scripting
hi,
can any one help me to correct this function call.
awk -F "," '{ {first=$1; sec=$2; tro=$3;quat=$4 }
if (tro == "")
{
$3 = search "$file2" "$first" "$file3"
{print $1","$2","$3","$4} }
else
{print $1","$2","$3 $4}}' $file1 > $file
search ()
{ (2 Replies)
Discussion started by: kamel.seg
2 Replies
7. Shell Programming and Scripting
Hi,
I have a string corresponding to a function. How I can call that function without if statement?
Thanks in advance. (4 Replies)
Discussion started by: Zaxon
4 Replies
8. Shell Programming and Scripting
Hi foiks
i am unable to find what is wrong in my code
mu functionality is to exit from shell when i give 99 but it is not calling function ext
Could you please correct me.
read option
if ;
then
ext
else
echo "out"
fi
function ext
{
echo "tested 99 and exit... (12 Replies)
Discussion started by: kojo
12 Replies
9. Emergency UNIX and Linux Support
Hi,
I am running a perl script to automate a process and I keep running into a error can't find the "value"
Can't call method "value" on an undefined value at process_file.pl line 44.
file is CVS
cell is ifdfdxrfmp.ksh
Here is the script I have also attached it as well:
... (2 Replies)
Discussion started by: vpundit
2 Replies
10. Shell Programming and Scripting
Hi
I have created a function in a Shell Script test.sh
function fnTest()
{
echo "My first Method
}
I have called this function in my test.sh
cat abc.txt | grep "test"
echo " test"
fnTest
But while running the shell script i got the following error:
... (2 Replies)
Discussion started by: nanthagopal
2 Replies
LEARN ABOUT HPUX
xmscrollvisible
XmScrollVisible(library call) XmScrollVisible(library call)
NAME
XmScrollVisible -- A ScrolledWindow function that makes an invisible
descendant of a ScrolledWindow work area visible
SYNOPSIS
#include <Xm/ScrolledW.h>
void XmScrollVisible(
Widget scrollw_widget,
Widget widget,
Dimension left_right_margin,
Dimension top_bottom_margin);
DESCRIPTION
XmScrollVisible makes an obscured or partially obscured widget or gadget descendant of a ScrolledWindow work area visible. The function re-
positions the work area and sets the specified margins between the widget and the nearest viewport boundary. The widget's location relative
to the viewport determines whether one or both of the margins must be adjusted. This function requires that the XmNscrollingPolicy of the
ScrolledWindow widget be set to XmAUTOMATIC.
scrollw_widget
Specifies the ID of the ScrolledWindow widget whose work area window contains an obscured descendant.
widget Specifies the ID of the widget to be made visible.
left_right_margin
Specifies the margin to establish between the left or right edge of the widget and the associated edge of the viewport. This
margin is established only if the widget must be moved horizontally to make it visible.
top_bottom_margin
Specifies the margin to establish between the top or bottom edge of the widget and the associated edge of the viewport. This
margin is established only if the widget must be moved vertically to make it visible.
For a complete definition of ScrolledWindow and its associated resources, see XmScrolledWindow(3)
RELATED
XmScrolledWindow(3).
XmScrollVisible(library call)