01-04-2009
You could put the command string into an executable script and then call that script with the C system() call. Then test the shell script independently of the C program. Note the space characters on the line.
system( "myscript" )
I believe that the C system() call execs to /usr/bin/sh (see "man 3s system").
The command syntax you are using is not valid in /usr/bin/sh .
Not clear what you intended to capture into "log", but in sh the "(" must be the first character on the command line in that context.
Valid in sh:
(time echo "hello world")
Invalid in sh:
time (echo "hello world")
BTW. If you have syntax which requires a different shell, place the shell name at the top of the called script in the usual manner. e.g.:
#!/usr/bin/myshell
10 More Discussions You Might Find Interesting
1. Programming
Hi
i used the following code to copy a directory from a source location to dest.
argv contains the source loc i/p by the user.
strcpy(source,argv);
strcpy(dest,"/home/MainServer/Job_dir/");
system("cp -r $source $dest");
it complies properly but during execution of the program it... (2 Replies)
Discussion started by: mridula
2 Replies
2. Shell Programming and Scripting
Can this be done without using te system command? I have a directory with a large number of files in it, but I am interested in only the 8 most recent.
The directory looks like
-rw-rw-rw- 1 adsm adsm 13412 Sep 22 08:31 events_dump_09222005.csv.gz
-rw-rw-rw- 1 adsm adsm ... (5 Replies)
Discussion started by: reggiej
5 Replies
3. Programming
Hi
In my code am openeing a mozilla in Solaris with some url using sytem(url)
this is working fine for most of the urls but for url of type-
www.abc.com?action=p&a=23
it is passing only www.abc.com?action=p to the browser & thus the url is not opening properly.
Why is system command... (7 Replies)
Discussion started by: nimishm
7 Replies
4. Shell Programming and Scripting
Hi,
I'm wanting to run an nslookup, dig or whatever to check for the existence of a printer. The PERL script will display the results on the screen, but I can't figure out how to capture the result & test the value. Any ideas will be greatly appreciated!!! Thank You (1 Reply)
Discussion started by: lorik
1 Replies
5. Shell Programming and Scripting
I was trying commands within awk. i got stuck here. i take 2 files.
cat input
first
second
third
fourth
fifth
sixth
seventh
eighth
ninht
tenthcat add
***************
Nirbhay
***************i run the command
awk '{ if ( NR == 5 ) { print system("cat add") "\n" $0 } else {... (4 Replies)
Discussion started by: nirbhay
4 Replies
6. AIX
Hello..
Plz, Any one can help me ?
when I execute a printing system with the command lp -d<name of printer>, no result with all printers.
I have verified the three processes : qdaemon, lpd, writesrv (No problem).
thank's (0 Replies)
Discussion started by: okbainf
0 Replies
7. UNIX for Dummies Questions & Answers
Hello All,
I am trying to run this system command from batch file.....
my @filename = ( 'cleartool', 'find', '. -type', 'f', '-ver','lbtype_sub(baseline name)', '-print' );
system(@filename);
But while executing the batch it is throwing this error:
cleartool: Error: Pathname not found:... (1 Reply)
Discussion started by: suvenduperl
1 Replies
8. Programming
The man system says
During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored.
What does this mean?
And if i am making a function that does what system does how do i write this signal stuff? (19 Replies)
Discussion started by: omega666
19 Replies
9. Shell Programming and Scripting
Hi
I have created a perl script & running it using Linux machine. I want my script to die when system command is unsuccessful but script is dying even when system command gets executed successfully. :wall:
I am using the command below :-
system($cmd) || die "FAILED $!";
print "Hello";
... (2 Replies)
Discussion started by: Priyanka Gupta
2 Replies
10. Shell Programming and Scripting
Hi,
I have a file 'acct_07756734.dat' and need to do some grep operation from a script
grep 'usage' acct_07756734.dat|wc -l
8
I need to do the same operation in aperl script,its is like
system(grep 'usage' acct_07756734.dat|wc -l);
in this case I wont be getting the value '8',instead success... (4 Replies)
Discussion started by: rkrish
4 Replies
LEARN ABOUT DEBIAN
gst-md5sum-0.8
gst-md5sum-0.8(1) User Commands gst-md5sum-0.8(1)
NAME
gst-md5sum-0.8, gst-md5sum - get an md5sum of a GStreamer pipeline through md5sink
SYNOPSIS
gst-md5sum-0.8 [--verbose] [gst-std-options] [partial-pipeline-description]
gst-md5sum [--verbose] [gst-std-options] [partial-pipeline-description] [--gst-list-mm] [--gst-mm=string] [--print]
DESCRIPTION
gst-md5sum-0.8 generates MD5 checksums of the data generated by a GStreamer pipeline.
In theory, both of the following commands should print out the same checksum:
gst-md5sum-0.8 filesrc location=music.mp3
md5sum music.mp3
If the pipeline contains an md5sink element, gst-md5sum-0.8 queries it for the md5sum at the end of pipeline iteration. If the pipeline
does not contain an md5sink element, gst-md5sum-0.8 automatically connects an md5sink to the right-hand side of the given pipeline.
See gst-launch(1) or the GStreamer documentation for more information on how to create a partial-pipeline-description.
gst-md5sum is a wrapper script that runs the latest installed version of gst-md5sum-X.X. For example, if both gst-md5sum-0.7 and gst-
md5sum-0.8 are installed on your system, gst-md5sum runs gst-md5sum-0.8.
OPTIONS
The following options are supported by gst-md5sum-0.8 and gst-md5sum:
--verbose Output verbose information. You can also use -v to specify this option.
gst-std-options Standard options available for use with most GStreamer applications. See gst-std-options(5) for more information.
The following options are supported by gst-md5sum only:
--gst-list-mm List found major/minor versions. This option displays the versions that are available.
--gst-mm=string Force major/minor version. This option enables you to specify a specific version to run, if you do not want to run the
default version.
--print Print wrapped command line. This option displays the command that will be run, and then runs the command.
OPERANDS
The following operands are supported:
partial-pipelinePartialppipeline description.
EXAMPLES
Example 1: Running the Wrapper Script and Displaying the Command Name
example% gst-md5sum --print
/usr/bin/gst-md5sum-0.8
FILES
The following files are used by this application:
/usr/bin/gst-md5sum-0.8 Executable for GNOME help browser
/usr/bin/gst-md5sum Wrapper script that runs the latest installed version of gst-md5sum-X.X
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-media |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
gst-complete(1), gst-compprep(1), gst-feedback(1), gst-inspect(1), gst-launch(1), gst-launch-ext(1), gst-register(1), gst-thumbnail(1),
gst-typefind(1), gst-xmlinspect(1), gst-xmllaunch(1), gstreamer-properties(1), libgstreamer-0.8(3), libgstgetbits(3), gst-std-options(5)
NOTES
Original man page written by the GStreamer team at http://gstreamer.net/.
Updated by Brian Cameron, Sun Microsystems Inc., 2004.
SunOS 5.10 14 Oct 2004 gst-md5sum-0.8(1)