9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I am trying a shell script for automatically login to test servers and pulling the output of top command from all using expect.
----snippet of code ---
#!/usr/bin/expect -f
#!/bin/bash
server1=10.251.222.51
server=("$server1")
i=1
for exp_server in ${server}; do
expect -c... (3 Replies)
Discussion started by: Renjesh
3 Replies
2. Shell Programming and Scripting
i have following input file...
00290002STDR000000000000000000000000000EOD END TRANSACTION ^@^@^@^@^@^@^@^@^@^@^@^@^
00299998STDR070000000007000000000000000STANDING DEBITS ^@^@^@^@^@^@^@^@^@^@^@^@^... (1 Reply)
Discussion started by: sagarrd
1 Replies
3. Shell Programming and Scripting
considering all variables like S01DEPOSITS will return numbers, i am trying to execute below statement
if ]
then
echo "Queue DEP"
fi
while executing above if statement i am getting error as
if : Syntax error at line 100 : `"$1"' is not expected.
pls help as soon as possible thanks (3 Replies)
Discussion started by: sagarrd
3 Replies
4. Shell Programming and Scripting
I'm trying to add logging to an existing script which echos a number of lines to the screen. I've added a switch to the script that is going to suppress much of this output and put it in a file instead.
The way I envisioned it was like this:
$log would be set to either "" or the log files... (8 Replies)
Discussion started by: cheetobandito
8 Replies
5. Shell Programming and Scripting
I am trying to implement a login screen to the following code how would i go about doing so. I have try to place the password in a variable using if statements which would usually work but as i have the system in a while loop i think i need to find another method.
#!/bin/bash
#Filename:... (4 Replies)
Discussion started by: warlock129
4 Replies
6. Programming
Hello,
I am trying to implement TCP protocol in C.
I have read the RFC for TCP and have knowledge about it.
But I am stuck in coding.
Are ther any reference links, code snippets available for reference? (1 Reply)
Discussion started by: Harsh
1 Replies
7. IP Networking
i have a client server connection steady and running... but the problem here is that the file transfer is very crude and succeptible to risks... so i want to implement ftp.. can anybody suggest a way to implement it or any book to read? (4 Replies)
Discussion started by: damn_bkb
4 Replies
8. Programming
Hi,
I am implementing a shell in C, with the following problem...
Suppose the shell is invoked from the command line as
>> myshell < test.in > test.out 2>&1
I have to execute the commands in test.in and redirect them to test.out
How does one detect in the main function that the shell... (1 Reply)
Discussion started by: jacques83
1 Replies
9. Programming
I'm implementing a shell in C that supports piping, output redirection, and background processing, and a few other commands. I was wondering how I'd go about implementing the output redirection. So, I'd open a file and I'd fork and execute the command. But how would I get stdout into the file? Any... (10 Replies)
Discussion started by: ununium
10 Replies
scds_timerun(3HA) Sun Cluster HA and Data Services scds_timerun(3HA)
NAME
scds_timerun - execute a given command in a given amount of time
SYNOPSIS
cc [flags...] -I /usr/cluster/include file -L /usr/cluster/lib -l dsdev
#include <rgm/libdsdev.h>
scha_err_t scds_timerun(scds_handle_t handle, const char *command,
time_t timeout, int signal, int *cmd_exit_code
DESCRIPTION
The scds_timerun() function executes a specified command using hatimerun(1M). If the command does not complete within the allotted time
period,which is specified by the timeout argument, scds_timerun() sends a signal, specified by the signal argument, to kill it.
The command argument does not support I/O redirection. However, you can write a script to perform redirection and then identify this
script in the command argument as the command for scds_timerun() to execute.
PARAMETERS
The following parameters are supported:
handle The handle returned from scds_initialize(3HA)
command String containing the command to run
timeout Time, in seconds, allotted to run the command
signal Signal to kill the command if it is still running when the timeout expires. If signal = -1, then SIGKILL is used. See
signal(3HEAD).
cmd_exit_code Return code from execution of the command
RETURN VALUES
The scds_timerun() function returns the following:
0 The function succeeded.
non-zero The function failed.
ERRORS
SCHA_ERR_NOERR The command executed and cmd_exit_code contains the child program's exit status.
SCHA_ERR_INTERNAL The timeout did not occur, but some other error was detected by scds_timerun() that was not an error
detected by the child program. Or hatimerun(1M) caught the signal SIGTERM.
SCHA_ERR_INVAL There was an invalid input argument.
SCHA_ERR_TIMEOUT The timeout occurred before the command specified by the command argument finished executing.
See scha_calls(3HA) for a description of other error codes.
FILES
/usr/cluster/include/rgm/libdsdev.h
Include file
/usr/cluster/lib/libdsdev.so
Library
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscdev |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
hatimerun(1M), scds_initialize(3HA), scha_calls(3HA), signal(3HEAD), attributes(5)
Sun Cluster 3.2 7 Sep 2007 scds_timerun(3HA)