10-12-2011
Leave off the | bc and see what you're actually feeding into bc. If your script prints anything, you'll have to redirect that to /dev/null so that it doesn't get fed into bc.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I check what kornshell version I am using at runtime from within a kornshell script? (3 Replies)
Discussion started by: qanda
3 Replies
2. Shell Programming and Scripting
Hi Folks...
I am using a ksh script to submit the at command to run a shell script for immediate execution. The shell script requries 1 parameter.
Command in the script is
at -m -f $EXE_DIR/process_server.sh $START_TIME $DB_NAME
where START_TIME=now and DB_NAME= tnsname of Oracle... (1 Reply)
Discussion started by: island360
1 Replies
3. AIX
How to allocate memory for a shell script on aix box at the time of execution i.e at runtime
Are there any commands for AIX in specific
Thanks in Advance (1 Reply)
Discussion started by: aixjadoo
1 Replies
4. UNIX for Dummies Questions & Answers
How to allocate memory for a shell script on aix box at the time of execution i.e at runtime
Are there any commands for AIX in specific
Thanks in Advance (3 Replies)
Discussion started by: aixjadoo
3 Replies
5. UNIX for Advanced & Expert Users
How to allocate memory for a shell script on aix box at the time of execution i.e at runtime
Are there any commands for AIX in specific
Thanks in Advance (1 Reply)
Discussion started by: aixjadoo
1 Replies
6. Shell Programming and Scripting
hi I am new to shell programming.....my question is while running one of my shell program it stops in between to accept input from the user and proceeds furthur after giving input....I want to know whether I can set this input through some files so that the shell acript reads the input from the... (10 Replies)
Discussion started by: santy
10 Replies
7. Shell Programming and Scripting
Hi,
I am trying to capture runtime stats of a shell script (c shell). Are there system variables to call? Or should I create a date variable at the start of the script and at the end of the script? I am trying to capture the time if the script stops or ends with error.
Please help.
... (4 Replies)
Discussion started by: CKT_newbie88
4 Replies
8. Shell Programming and Scripting
so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to... (3 Replies)
Discussion started by: navlelo
3 Replies
9. Shell Programming and Scripting
HI Help,
I have a file which looks like below ---
Input file --->
1970113.00000 3460.00000 1.09516
1970116.00000 3791.00000 1.06350
1970120.00000 4120.00000 1.07588
1970115.00000 4450.00000 1.09591
1970116.00000 4780.00000 1.09965
1970120.00000 5109.00000 1.06733 ... (7 Replies)
Discussion started by: Indra2011
7 Replies
10. Shell Programming and Scripting
Hi All,
I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them
abc.sh
----------
export Numbr_Parms=$#
export a=1
while
do
export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
LEARN ABOUT NETBSD
daemon
DAEMON(3) BSD Library Functions Manual DAEMON(3)
NAME
daemon -- run in the background
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
int
daemon(int nochdir, int noclose);
DESCRIPTION
The daemon() function is for programs wishing to detach themselves from the controlling terminal and run in the background as system daemons.
Unless the argument nochdir is non-zero, daemon() changes the current working directory to the root (/).
Unless the argument noclose is non-zero, daemon() will redirect standard input, standard output and standard error to /dev/null.
RETURN VALUES
On return 0 indicates success with -1 indicating error.
ERRORS
The function daemon() may fail and set errno for any of the errors specified for the library functions fork(2) and setsid(2).
SEE ALSO
fork(2), setsid(2)
HISTORY
The daemon() function first appeared in 4.4BSD.
CAVEATS
Unless the noclose argument is non-zero, daemon() will close the first three file descriptors and redirect them to /dev/null. Normally,
these correspond to standard input, standard output and standard error. However, if any of those file descriptors refer to something else
they will still be closed, resulting in incorrect behavior of the calling program. This can happen if any of standard input, standard output
or standard error have been closed before the program was run. Programs using daemon() should therefore make sure to either call daemon()
before opening any files or sockets or, alternately, verifying that any file descriptors obtained have a value greater than 2.
BUGS
daemon() uses fork() as part of its tty detachment mechanism. Consequently the process id changes when daemon() is invoked. Processes
employing daemon() can not be reliably waited upon until daemon() has been invoked.
BSD
September 3, 1999 BSD