11-26-2010
Wow! this was very simple. Option 2) worked for me and I am sure that option 3) would work as well. Thank you very much Mr
ctsgnb.
10 More Discussions You Might Find Interesting
1. Programming
i just finished a project for a c++ class that i wrote at home on my computer, compiled with gcc. when i brought the code into school it would not compile, it would complain that cannot call main() function. at school we use ancient borland c++ from 1995. anyway my program has 20 different... (3 Replies)
Discussion started by: norsk hedensk
3 Replies
2. Shell Programming and Scripting
Ok, I have written a main script which checks a directory contents every 30 secs then sleeps. The subscript does a usermod, if the user is logged on, it sleeps for 30 secs and then trys again over and over again.
Here's the problem. when the subscript is called ./subscript.sh or exec... (1 Reply)
Discussion started by: doublejz
1 Replies
3. Programming
What is the sytax to return an int from C program main back to calling shell?
#!/usr/bin/ksh
typeset -i NO_RECS
$NO_RECS=process_file
# Process file is a C program that is set up to return an int from main. The
#program complies with no issues, but an error is generated when the... (3 Replies)
Discussion started by: flounder
3 Replies
4. Programming
main()
{
pid_t child;
child=fork();
if(child > 0)
{sleep(60);
}
else
{exit(0);
}
}
the above code will create zombie process,which will be adopted by init as soon as parent process will dies.Can any one gimme a code or an alogrithm to keep this zombie proocess alive even after... (6 Replies)
Discussion started by: anilchowdhury
6 Replies
5. UNIX for Dummies Questions & Answers
Hi. I have a problem in running a program in linux system. This program (damaver.l86) is in the path /home/shenk/damaver/, and it needs to call another program (supcomb.l86) in another path /home/shenk/supcomb/. I tried to modified the .bash_profile, but it didn't work. The error message is always... (1 Reply)
Discussion started by: shenk
1 Replies
6. UNIX for Dummies Questions & Answers
hi everyone ,
i want to read an option and depending on the option call the program .For ex
#! /bin/ksh
export JAVA_HOME=/home/oracle/jdk1.6.0_20
echo " Please enter mod-modeler, dev - sqldeveloper"
read choice
if ; then
echo ' SQL DEVELOPER IS STARTING NOW ... '
cd... (0 Replies)
Discussion started by: kdev
0 Replies
7. Shell Programming and Scripting
I have some csh and awk scripts on path
/nethome/chrisd/HSeis/TommyCD/TommyCD-1101/Scripts
Usually I have a working directory from where I run the scripts by having a soft link to the Scripts directory
in the directory above the working one
For example from
... (4 Replies)
Discussion started by: kristinu
4 Replies
8. Homework & Coursework Questions
Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies
9. AIX
Hello All,
I am trying to call a function from the calling main program from a dlopened library function, below is the entire code, when I execute it it crashes with sigill. Can you guys help me out I guess I am missing out on the linker flag or something here. besides I am new to AIX and... (1 Reply)
Discussion started by: syedtoah
1 Replies
10. UNIX and Linux Applications
Hello,
just a silly question, do you know some server that can be used for simple calling (soft phone on Android) and messaging between three users? Something like Asterisk but lightweight just for family use I can add to my VPS.
Many thanks,
Stan (0 Replies)
Discussion started by: brusell
0 Replies
LEARN ABOUT NETBSD
getprogname
GETPROGNAME(3) BSD Library Functions Manual GETPROGNAME(3)
NAME
getprogname, setprogname -- get/set the name of the current program
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
const char *
getprogname(void);
void
setprogname(const char *name);
DESCRIPTION
These utility functions get and set the current program's name as used by various error-reporting functions.
getprogname() returns the name of the current program. This function is typically useful when generating error messages or other diagnostic
output. If the program name has not been set, getprogname() will return NULL.
setprogname() sets the name of the current program to be the last pathname component of the name argument. It should be invoked at the start
of the program, using the argv[0] passed into the program's main() function. A pointer into the string pointed to by the name argument is
kept as the program name. Therefore, the string pointed to by name should not be modified during the rest of the program's operation.
A program's name can only be set once, and in NetBSD that is actually done by program start-up code that is run before main() is called.
Therefore, in NetBSD, calling setprogname() explicitly has no effect. However, portable programs that wish to use getprogname() should call
setprogname() from main(). On operating systems where getprogname() and setprogname() are implemented via a portability library, this call
is needed to make the name available.
SEE ALSO
err(3), setproctitle(3)
HISTORY
The getprogname and setprogname function calls appeared in NetBSD 1.6.
RESTRICTIONS
The string returned by getprogname() is supplied by the invoking process and should not be trusted by setuid or setgid programs.
BSD
May 21, 2011 BSD