10 More Discussions You Might Find Interesting
1. Programming
Hi,
In multi-level inheritance:
class A {
public:
void fun() { cout << "A" << endl; }
};
class B : public A {
public:
void fun() { cout << "A" << endl; }
};
class C : public B { };
int main() {
C c;
c.fun(); // Ans: A
} (1 Reply)
Discussion started by: royalibrahim
1 Replies
2. UNIX for Dummies Questions & Answers
im new to bash scripting and im just using online tutorials and trial and error. i wanted to write a script to read numbers from a file and find their sum:
#!/bin/bash
theSum=0
for line in $(cat numbers.txt)
do
let "theSum = theSum + $line"
echo "$line"
done
echo "The sum is... (3 Replies)
Discussion started by: astrolux444
3 Replies
3. Shell Programming and Scripting
Hi,
I have the below script executed
arg="dir"
if "$arg" = "dir"
then
echo "true"
else
echo "false"
fi
Please let me know what happens in the if command.
My output is:
dir: dir: No such file or directory
false
which is not the desired output.
When i used test command... (1 Reply)
Discussion started by: anijan
1 Replies
4. UNIX for Dummies Questions & Answers
All,
THe below is my script , when i use this i am getting nothing . could any one help me to know what is the use of the << operator below
su - $8 << supo
echo "exportsph $2 $1 $3 $4"
exportsph $2 $1 $3 $4
supo
i also tried as individual command su - userid << supo , when i do... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
5. Shell Programming and Scripting
Hello,
I was written a cgi with a textarea to save some words from web.
I grab and write words like this:
$cgiparams{'CONTENTS'} =~ s/\r//g;
#$cgiparams{'CONTENTS'} =~ s/á/á/g;
open(TM, ">$editedfilename");
#binmode(TM,... (1 Reply)
Discussion started by: Zaxon
1 Replies
6. Programming
Hi,
Please clear the 2 questions,
2 Questions,
1) Why the new as a operator? Is there any special reason why it can't be a function like malloc?
2) How are we considering sizeof(),new are as a opearartors? I know + - * / -> , . etc.. are operators, which criteria satisfied by sizeof()... (4 Replies)
Discussion started by: Nagapandi
4 Replies
7. AIX
Hi All,
I found a strange thing in one of our DB server.
one of the file system /orcale/ABC/rman size df output showing 100% full eventhough its occupying 2.18MB
$ df -mP /oraclev/ABC/rman
Filesystem MB blocks Used Available Capacity Mounted on
/dev/lv20906 1024.00 1024.00 0.00 100%... (2 Replies)
Discussion started by: ram1729
2 Replies
8. Programming
1 #include <fcntl.h>
2
3 main(int argc, char *argv)
4 {
5 char buf;
6 int fd, count = 0;
7
8 if (argc > 1)
9 fd = open(argv, O_RDONLY);
10 else
11 fd = 0; /* Use standard input */
12
13 while (read(fd, buf, 1) > 0) {
14 if (count < 5) write(1, buf, 1);
15 ... (3 Replies)
Discussion started by: bishweshwar
3 Replies
9. HP-UX
hi,
i was trying to club to test condition with if.
if -o ; then
it is giving me error message, i wanted to ask how can we check two condtions with one if. (1 Reply)
Discussion started by: babom
1 Replies
10. Shell Programming and Scripting
I am trying to check two variables and if both are blank I want to set a flag:
the_f3_pid=`rsh $target ps -ef | grep "f3.eab" | awk '{print $2}'`
the_f7_pid=`rsh $target ps -ef | grep "f7.eab" | awk '{print $2}'`
if ; then
y=1
fi
I get an error:
./script_name: test: 0403-021 ]... (4 Replies)
Discussion started by: rcarnesiii
4 Replies