12-18-2012
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. Shell Programming and Scripting
Hi,
I have a menu driven script that does various tasks, I want to be able to call functions directly from within other unix scripts from my menu script. Is this possible? (12 Replies)
Discussion started by: LiquidChild
12 Replies
5. Shell Programming and Scripting
Hi,
I have a K shell
a.ksh
function abc {
// Some logic
}
In
b.ksh
i have included the a.ksh
./a.ksh
I want to call the abc function from this b.ksh script.
Thanks
Vijay (2 Replies)
Discussion started by: vijaykrc
2 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 am trying to understand a program in a book and this program suppose to call other programs which are in the same folder, the other programs are called 'lu' and 'add' but for some reason when it gets to the last line of each case to call these programs there is an error message saying
./rolo:... (2 Replies)
Discussion started by: bartsimpsong
2 Replies
8. Shell Programming and Scripting
Greetings,
I m wondering if it's possible do do the following :
I have a simple function called "FindMoveDelete" which does the following :
FindMoveDelete()
{
find . -iname "$FILENAME*.ext" -exec mv {} "$PATH/$VAR" \; &&
find . -maxdepth 1 -type d -iname "$FILENAME*" -exec rm -rf {}... (6 Replies)
Discussion started by: Sekullos
6 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
I need help moving working code into library function called obj13-lib.pl and call the same function in obj13-2.pl
I am a Linux newbie and this certificate is my first step... (0 Replies)
Discussion started by: cllinuxhelp
0 Replies
10. Shell Programming and Scripting
I'm trying to call some functions in the background so that I can multitask in this script. Not working so hot. The functions I call don't ever seem to get called. I'm doing it the exact same way in another script and it's working like a champ so I'm very confused. Here's a pretty simple repro:
... (7 Replies)
Discussion started by: stonkers
7 Replies
LEARN ABOUT NETBSD
setprogname
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