So if POSIX mode is taken as a maximum to be usable "everywhere" then we do not have to worry about excessive arguments. See your limits.h file, or sysconf() man page.
A good solution might be to write a script on the fly, then call system(), popen() or even fork()/exec() to run your text - commands string. The point being that a "universal" accepted lowest limit is pretty small, especially if you factor in ENV variables.
Hi,
Though I should check this myself.. but I don't have a cc compiler at this time.. :(
When I compile a c program containing say system(myshell.sh).. do the executable require that the actual script myshell.sh to be present whenever it executes? I guess it needs..
otherwise I can just... (1 Reply)
Hai Friends
I have used the function system() to execute a command. My requirement is that i have to list the files in a directory applying some wildcard paterns. For example if i want to list *.c files i go with the function
system("ls *.c");
and the output gets printed on the monitor.... (1 Reply)
Hi, I have a task to search for a file called 'Xstartup' in the whole system because there might be different versions of it which overrite eachother.
Can anyone suggest a smart command to run this search ? The machine needs to scan every single folder beginning from root.
Please help, I am... (5 Replies)
Hi, guys ,,
I want to know the implementation of System() function in C Unix, and its prototype definition:
int system(const char * string) in the header file <stdlib.h> ??!
please help me ! because that is part of my project !! (0 Replies)
Hi all,
I am calling a shell function within awk using system. I am struggling to get my expected output:
#!/bin/sh
set -o nounset
BEG=44
END=55
shfun()
{
echo "1|2|3"
}
export -f shfun
typeset -F > /dev/null
awk 'BEGIN {OFS="|"; print "'"$BEG"'",system( "shfun"... (5 Replies)
Hi All,
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode' commands for the same and those worked fine. Please find below the same.
X " ( cat /sastemp/body.txt; uuencode test.xls test.xls ) | mailx -s 'testing'... (1 Reply)
Could any one tell me how to use the system function in awk?
I want to use it to print the system date.
I have been trying like this :
yes |head -1|awk '{ system("date")}'
When I execute the above it always returns back to the prompt.
Your help would be much appreciated.
regards,... (3 Replies)
Hi Guys ,
I want to use system function in C to do the following work.
cp <file1> <file2> and then ><file1>
e,g cp \var\log\cpm_cpmd_1.log.1 \var\log\cpm_cpmd_1.log.2 and then
>\var\log\cpm_cpmd_1.log.1
1. g_config_info.cpmm_config.cpm_log_path=\var\log\
2. ... (3 Replies)
I am scanning a file (line by line) for format errors. A line could have multiple errors. Each field in the line is evaluated for errors and sent, along w/ any error messages, to a temporary file. Finally, if any errors were detected, this temporary file is then appended to the errorFile. The... (4 Replies)
Hello Friends,
I have written a script like below,
I aimed to move some CDR files (call data record) whose the last field is "1" (NF=1 ) from a spesific directory to a new directory
Field Seperator is pipe.
If the directory does not exitst i should create it.
I will give the script two... (5 Replies)
Discussion started by: EAGL€
5 Replies
LEARN ABOUT DEBIAN
explain_system_or_die
explain_system_or_die(3) Library Functions Manual explain_system_or_die(3)NAME
explain_system_or_die - execute a shell command and report errors
SYNOPSIS
#include <libexplain/system.h>
void explain_system_or_die(const char *command);
void explain_system_success_or_die(const char *command);
int explain_system_success(const char *command);
DESCRIPTION
These functions may be used to execute commands via the system(3) function, and report the results.
explain_system_or_die
void explain_system_or_die(const char *command);
The explain_system_or_die function is used to call the system(3) system call. On failure an explanation will be printed to stderr,
obtained from explain_system(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
int status = explain_system_or_die(command);
command The command, exactly as to be passed to the system(3) system call.
Returns:
This function only returns on success, see system(3) for more information. On failure, prints an explanation and exits.
explain_system_success_or_die
void explain_system_success_or_die(const char *command);
The explain_system_success_or_die function is used to call the system(3) system call. On failure, including any exit status other than
EXIT_SUCCESS, an explanation will be printed to stderr, obtained from explain_system(3), and then the process terminates by calling
exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_system_success_or_die(command);
command The command, exactly as to be passed to the system(3) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
explain_system_success
int explain_system_success(const char *command);
The explain_system_success function is used to call the system(3) system call. On failure, including any exit status other than EXIT_SUC-
CESS, an explanation will be printed to stderr, obtained from explain_system(3). However, the priniting of an error message does not also
cause exit(2) to be called.
This function is intended to be used in a fashion similar to the following example:
int status = explain_system_success(command);
command The command, exactly as to be passed to the system(3) system call.
Returns:
the value returned by the system(3) system call. In all cases other than EXIT_SUCCESS, an error message will also have been
printed to stderr.
SEE ALSO system(3)
execute a shell command
explain_system(3)
explain system(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_system_or_die(3)