Sponsored Content
Top Forums Shell Programming and Scripting calling a program (w/ params) from within shell Post 302268175 by siba.s.nayak on Monday 15th of December 2008 06:22:46 AM
Old 12-15-2008
If you know how to pass parameters to a FOTRAN file. then hust call the obj file from you script. and pass the args to the object file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling SHELL script from C program

Hi, I just tried to call a simple script from a pretty simple C program. I could not succeed :-( a message was thrown saying "sh: line 1: "Script name with path": Permission denied" The C program and shell script are below, both are in the same directory and shell script is given... (7 Replies)
Discussion started by: Chanakya.m
7 Replies

2. UNIX for Advanced & Expert Users

calling program

hi, i have a script.sh on my machine and it used in the system but my question is how can i know the program called this script.sh?? i.e. from where it called and execute?? Many thanks (1 Reply)
Discussion started by: alzuma
1 Replies

3. Shell Programming and Scripting

Calling Functions of Other K Shell Program

Hi, I have a K shell a.ksh function abc { // Some logic } In b.ksh i have included the a.ksh ./a.ksh I want to call the abc function from this b.ksh script. Thanks Vijay (2 Replies)
Discussion started by: vijaykrc
2 Replies

4. UNIX for Advanced & Expert Users

calling a Universe program

Can someone offer some technical advice concerning an call to a IBM U2 (Universe) program? When I use the following script from a unix shell, it works fine: $ " xxx.sh " (contains the following --->) 1. cd /links/ACCOUNT1 2. /shapps/ibm/uv/bin/uv "COUNT FILE1" ... (2 Replies)
Discussion started by: smintz
2 Replies

5. Shell Programming and Scripting

Run shell script from C program by calling fork and execl

I need to write a c program that uses the fork and excel system calls to run the shell script mode invoked like this: "./mode 644 ls -l" (that is the argumetns will always be 644 ls -l) here's the mode script: #!/bin/sh octal="$1" shift find . -maxdepth 1 -perm $octal -exec $@ {} \; ... (3 Replies)
Discussion started by: computethis
3 Replies

6. Shell Programming and Scripting

Calling a shell script from a C program

Hi, I have a shell script which connects to a database and fetches the count of the records from a table. I want to embed this whole script in a C program. Also the count fetched should be available in the C program for further usage. Please let me know how this can be done. Thanks ... (0 Replies)
Discussion started by: swasid
0 Replies

7. Programming

Calling a shell script from a C program

Hi, I have a shell script which connects to a database and fetches the count of the records from a table. I want to embed this whole script in a C program. Also the count fetched should be available in the C program for further usage. Please let me know how this can be done. Thanks (9 Replies)
Discussion started by: swasid
9 Replies

8. Shell Programming and Scripting

Calling perl script in shell program

How to call a perl script in shell program / shell scripting. PLS HELP ME (2 Replies)
Discussion started by: hravisankar
2 Replies

9. Homework & Coursework Questions

Calling compiled C program with Perl program

Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies

10. Programming

Program crashes on calling __libc_msgrcv()

Hi, I am a newbie to linux programming. I have implemented msgqueue in C. msgrcv() call at the client end is as below: msgrcv( msgqid, msgptr, msgsize, msgtype, 0 ); My program works fine when msgrcv () from /lib/libc.so.6 is called. However it crashes when __libc_msgrcv() is called. ... (3 Replies)
Discussion started by: praasanna
3 Replies
libapache2-mod-perl2-2.0.7::docs::api::Apache2::DirectivUsermContributed Perl Documelibapache2-mod-perl2-2.0.7::docs::api::Apache2::Directive(3pm)

NAME
Apache2::Directive - Perl API for manipulating the Apache configuration tree Synopsis use Apache2::Directive (); my $tree = Apache2::Directive::conftree(); my $documentroot = $tree->lookup('DocumentRoot'); my $vhost = $tree->lookup('VirtualHost', 'localhost:8000'); my $servername = $vhost->{'ServerName'}; use Data::Dumper; print Dumper $tree->as_hash; my $node = $tree; while ($node) { print $node->as_string; #do something with $node my $directive = $node->directive; my $args = $node->args; my $filename = $node->filename; my $line_num = $node->line_num; if (my $kid = $node->first_child) { $node = $kid; } elsif (my $next = $node->next) { $node = $next; } else { if (my $parent = $node->parent) { $node = $parent->next; } else { $node = undef; } } } Description "Apache2::Directive" provides the Perl API for manipulating the Apache configuration tree API
"Apache2::Directive" provides the following functions and/or methods: "args" Get the arguments for the current directive: $args = $node->args(); obj: $node ( "Apache2::Directive object" ) ret: $args ( string ) Arguments are separated by a whitespace in the string. since: 2.0.00 For example, in httpd.conf: PerlSwitches -M/opt/lib -M/usr/local/lib -wT And later: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('PerlSwitches'); my $args = $node->args; $args now contains the string "-M/opt/lib -M/usr/local/lib -wT" "as_hash" Get a hash representation of the configuration tree, in a format suitable for inclusion in <Perl> sections. $config_hash = $conftree->as_hash(); obj: $conftree ( "Apache2::Directive object" ) The config tree to stringify ret: $config_hash ( HASH reference ) since: 2.0.00 For example: in httpd.conf: <Location /test> SetHandler perl-script PerlHandler Test::Module </Location> And later: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('Location', '/test/'); my $hash = $node->as_hash; $hash now is: { 'SetHandler' => 'perl-script', 'PerlHandler' => 'Test::Module', } "as_string" Get a string representation of the configuration node, in httpd.conf format. $string = $node->as_string(); obj: $node ( "Apache2::Directive object" ) The config tree to stringify ret: $string ( string ) since: 2.0.00 For example: in httpd.conf: <Location /test> SetHandler perl-script PerlHandler Test::Module </Location> And later: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('Location', '/test/'); my $string = $node->as_string; $string is now: SetHandler perl-script PerlHandler Test::Module "conftree" Get the root of the configuration tree: $conftree = Apache2::Directive::conftree(); obj: "Apache2::Directive" ( class name ) ret: $conftree ( "Apache2::Directive object" ) since: 2.0.00 "directive" Get the name of the directive in $node: $name = $node->directive(); obj: $node ( "Apache2::Directive object" ) ret: $name ( string ) since: 2.0.00 "filename" Get the filename the configuration node was created from: $filename = $node->filename(); obj: $node ( "Apache2::Directive object" ) ret: $filename ( string ) since: 2.0.00 For example: my $tree = Apache2::Directive::conftree(); my $node = $tree->lookup('VirtualHost', 'example.com'); my $filename = $node->filename; $filename is now the full path to the httpd.conf that VirtualHost was defined in. If the directive was added with "add_config()", the filename will be the path to the httpd.conf that trigerred that Perl code. "first_child" Get the first child node of this directive: $child_node = $node->first_child; obj: $node ( "Apache2::Directive object" ) ret: $child_node ( "Apache2::Directive object" ) Returns the first child node of $node, "undef" if there is none since: 2.0.00 "line_num" Get the line number in a filename this node was created at: $lineno = $node->line_num(); obj: $node ( "Apache2::Directive object" ) arg1: $lineno (integer) since: 2.0.00 "lookup" Get the node(s) matching a certain value. $node = $conftree->lookup($directive, $args); @nodes = $conftree->lookup($directive, $args); obj: $conftree ( "Apache2::Directive object" ) The config tree to stringify arg1: $directive ( string ) The name of the directive to search for opt arg2: "args" ( string ) Optional args to the directive to filter for ret: $string ( string / ARRAY of HASH refs ) In LIST context, it returns all matching nodes. In SCALAR context, it returns only the first matching node. If called with only $directive value, this method returns all nodes from that directive. For example: @Alias = $conftree->lookup('Alias'); returns all nodes for "Alias" directives. If called with an extra $args argument, it returns only nodes where both the directive and the args matched. For example: $VHost = $tree->lookup('VirtualHost', '_default_:8000'); since: 2.0.00 "next" Get the next directive node in the tree: $next_node = $node->next(); obj: $node ( "Apache2::Directive object" ) ret: $next_node ( "Apache2::Directive object" ) Returns the next sibling of $node, "undef" if there is none since: 2.0.00 "parent" Get the parent node of this directive: $parent_node = $node->parent(); obj: $node ( "Apache2::Directive object" ) ret: "parent_node" ( "Apache2::Directive object" ) Returns the parent of $node, "undef" if this node is the root node since: 2.0.00 See Also mod_perl 2.0 documentation. Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. Authors The mod_perl development team and numerous contributors. perl v5.14.2 2011-02-08 libapache2-mod-perl2-2.0.7::docs::api::Apache2::Directive(3pm)
All times are GMT -4. The time now is 11:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy