Sponsored Content
Top Forums Programming C system() how to send the output to an array?? Post 302388328 by Jess83 on Wednesday 20th of January 2010 03:50:52 AM
Old 01-20-2010
Thanks Pludi, attention error... I noticed the memory allocated for the command i was trying to run was way not enough... Another part of the problem I was getting was with the buffer size I had allocated for my socket's buffer.

Thanks again Pludi I appreciate Smilie
 

10 More Discussions You Might Find Interesting

1. Programming

can we send arguments to system() call

Hi friends my C code is int main() { system("cp <source> <destination>"); } my question is how to set variables for <source> and <destination> how can we pass it to system() call. can you suggest me thankyou kingskar (6 Replies)
Discussion started by: kingskar
6 Replies

2. UNIX for Advanced & Expert Users

To send a message to another system

How to send a message to another unix terminal along with the date specified (4 Replies)
Discussion started by: aajan
4 Replies

3. UNIX for Dummies Questions & Answers

send message to a remote system

I am analyzing snoop output and want to send "Hello world" to a remote system. I want to see if the message received is encrypted or not. can I use ping to send a text message? like ping "helloworld" <IP Addr> Please help. Thank you (5 Replies)
Discussion started by: rakeshou
5 Replies

4. Solaris

how to send the output

Hi, how to send the output of a command directly to a file. For eg: am issuing metastat -a. How to send the output of this command to a file as well as mail. (3 Replies)
Discussion started by: rogerben
3 Replies

5. Shell Programming and Scripting

awk - Pre-populating an array from system command output

So, here's a scenario that requires the same logic as what I'm working on: Suppose that you have a directory containing files named after users. For awk's purposes, the filename is a single field-- something parse-friendly, like john_smith. Now, let's say that I'd like to populate an array in... (2 Replies)
Discussion started by: treesloth
2 Replies

6. Shell Programming and Scripting

System Output in to an Array or variable

hey guys in only new to scripting as such, but i have a problem. i want to take the output of a search i do in the command line to then be in a variable but only a certain part of the output. this this what im doing: -bash-2.05b$ ldapsearch -x '(dn:=dc)' dc|grep dc= # base... (1 Reply)
Discussion started by: jmorey
1 Replies

7. Filesystems, Disks and Memory

iostat output vs TPC output (array layer)

Hi Guys, I've been having some arguments with my colleagues about one thing. Always my thought was that as as far as disk performance is concern by looking at the output of the iostat command (AIX) you would be able to identify if you have a hot disk and then by moving some files out that disk... (3 Replies)
Discussion started by: arizah
3 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Reading Array And Send An Email

I am trying to find an example for reading an array instead of reading a file and send out an email in ksh. Can you please help is that possible? Algorithm #!/bin/ksh i=0 set -A ARR if then let i=$ ARR="A does n't match with B" fi if then let i=$ ARR="P does n't match with Q"... (11 Replies)
Discussion started by: Ariean
11 Replies

9. UNIX for Dummies Questions & Answers

Send files automatically to a remote system

Greetings, basically what I want to do is take the standard error from a cron file and store it on a file in a remote host (from Solaris to Linux). I want to create a cron file to do this everyday or put it on a script that will send it everyday to the other system (that doesnt matter). Any ideas... (2 Replies)
Discussion started by: picolin
2 Replies

10. Shell Programming and Scripting

I want query output to send on mail using table tag and output should be in table

#! /bin/ksh #] && . ./.profile 2>/dev/null if test -f '.profile'; then . ./.profile; fi; #. .profile LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( ... (21 Replies)
Discussion started by: ankit.mca.aaidu
21 Replies
buffer(3)							      OpenSSL								 buffer(3)

NAME
BUF_MEM_new, BUF_MEM_free, BUF_MEM_grow, BUF_strdup - simple character arrays structure SYNOPSIS
#include <openssl/buffer.h> BUF_MEM *BUF_MEM_new(void); void BUF_MEM_free(BUF_MEM *a); int BUF_MEM_grow(BUF_MEM *str, int len); char * BUF_strdup(const char *str); DESCRIPTION
The buffer library handles simple character arrays. Buffers are used for various purposes in the library, most notably memory BIOs. The library uses the BUF_MEM structure defined in buffer.h: typedef struct buf_mem_st { int length; /* current number of bytes */ char *data; int max; /* size of buffer */ } BUF_MEM; length is the current size of the buffer in bytes, max is the amount of memory allocated to the buffer. There are three functions which handle these and one "miscellaneous" function. BUF_MEM_new() allocates a new buffer of zero size. BUF_MEM_free() frees up an already existing buffer. The data is zeroed before freeing up in case the buffer contains sensitive data. BUF_MEM_grow() changes the size of an already existing buffer to len. Any data already in the buffer is preserved if it increases in size. BUF_strdup() copies a null terminated string into a block of allocated memory and returns a pointer to the allocated block. Unlike the standard C library strdup() this function uses OPENSSL_malloc() and so should be used in preference to the standard library strdup() because it can be used for memory leak checking or replacing the malloc() function. The memory allocated from BUF_strdup() should be freed up using the OPENSSL_free() function. RETURN VALUES
BUF_MEM_new() returns the buffer or NULL on error. BUF_MEM_free() has no return value. BUF_MEM_grow() returns zero on error or the new size (i.e. len). SEE ALSO
bio(3) HISTORY
BUF_MEM_new(), BUF_MEM_free() and BUF_MEM_grow() are available in all versions of SSLeay and OpenSSL. BUF_strdup() was added in SSLeay 0.8. 1.0.1e 2013-02-11 buffer(3)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy