02-17-2006
array as command line argument !!!!
hello,
can any help me how to can pass array as command line argument in korn shell.
also how to read a array from command line.
thanks
spandu
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how to parse the command line argument to look for '@' sign and the following with '.'.
In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format.
rmjoe123@hotmail.com has '@' sign and followed by a '.'
to be more... (1 Reply)
Discussion started by: rmjoe
1 Replies
2. Shell Programming and Scripting
Say I want to get the value of last command line argument using the value in $# (or some other way if u can suggest) how do I do it??
$"$#"
`$"$#"`
These don't work :( (4 Replies)
Discussion started by: amit_oddey21
4 Replies
3. Shell Programming and Scripting
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies
4. Programming
Hi,
I have a very simple C program which will run in UNIX. When i am passing * as the command line argument, i am gettig the below output.
Program:
#include <stdio.h>
#include "mylibrary.h"
int **environ;
int main(int argc,char *argv)
{
int i;
printf("\nHello... (2 Replies)
Discussion started by: dsudipta
2 Replies
5. Shell Programming and Scripting
I have to write a script to determine whether given command line argument ($1) contains "*" symbol or not, if $1 does not contains "*" symbol add it to $1, otherwise show message "Symbol is not required". For e.g. If we called this script q5 then after giving ,
$ q5 /bin
Here $1 is /bin, it... (5 Replies)
Discussion started by: cynosure2009
5 Replies
6. Shell Programming and Scripting
Hi Guys
When I run the below command
ssh -o 'PasswordAuthentication yes' -o 'PreferredAuthentications publickey' -i $HOME/.ssh/id_dsa Server_Name
I found the below error
ommand-line line 0: Missing yes/no argument
Kindly help me to sort out
Double post, continued... (0 Replies)
Discussion started by: Pratik4891
0 Replies
7. Shell Programming and Scripting
HI ,
I am new to csh. I need to pass some command line arguments like
./abc.sh -os Linux -path abc -tl aa -PILX 1
I have defined the loop as shown below. But its taking "-os" switches as arguments. Its treating them as arguments.
How to resolve it?
while ( $#argv != 0 )
switch ($argv)
... (7 Replies)
Discussion started by: vineet.dhingra
7 Replies
8. Shell Programming and Scripting
I would like to use a string as a command line argument...is this possible using TCSH? For example say my script is called TEST and I would like to pass a string into my script stating why the test failed.
EXAMPLE:
TEST "Failed due to missing statement" (4 Replies)
Discussion started by: thibodc
4 Replies
9. Shell Programming and Scripting
I'm trying to write a bash script called YN that looks like the following
YN "Specify a question" "doThis" "doThat"
where "doThis" will be executed if the answer is "y", otherwise "doThat".
For example
YN "Do you want to list the file dog?" "ls -al dog" ""
Here's my attempt... (3 Replies)
Discussion started by: LeoKSimon
3 Replies
10. UNIX for Beginners Questions & Answers
Hi Guys, I'm trying to work out how to add a command line argument inside single quotes. Would anyone be able to help please as I'm going mad :)
I want to be able to place the filename on command line and it then be used in a script but it needs to have quotes surrounding it.
Thanks in... (4 Replies)
Discussion started by: mutley2202
4 Replies
LEARN ABOUT HPUX
xtvaappinitialize
XtVaAppInitialize() XtVaAppInitialize()
Name
XtVaAppInitialize - initialize the X Toolkit internals, using varargs argument style.
Synopsis
Widget XtVaAppInitialize(app_context_return, application_class, options, num_options, argc_in_out, argv_in_out, fallback_resources, ...,
NULL)
XtAppContext *app_context_return;
String application_class;
XrmOptionDescList options;
Cardinal num_options;
int *argc_in_out; /* was type Cardinal * in Release 4 */
String *argv_in_out;
String *fallback_resources;
Inputs
application_class
Specifies the class name of the application.
options Specifies the command line options table.
num_options Specifies the number of entries in options.
argc_in_out Specifies a pointer to the number of command line arguments. This argument was a Cardinal * in Release 4, and is an int *
in Release 5.
argv_in_out Specifies the command line arguments array.
fallback_resources
Specifies resource values to be used if the application class resource file cannot be opened, or NULL.
..., NULL A NULL-terminated variable-length list of resource name/value pairs to override any other resource specifications for the
created shell.
Outputs
app_context_return
Returns the application context, if non-NULL.
Returns
A toplevel shell widget of class applicationShellWidgetClass.
Availability
Release 4 and later.
Description
XtVaAppInitialize() initializes the Toolkit internals, creates an application context, opens and initializes a display, and creates the
initial application shell. It is identical to XtAppInitialize() except that the args array of resource names and values and the num_args
argument of that function are replaced with a NULL-terminated variable-length argument list.
See XtAppInitialize() for more information on this function. See XtVaSetValues() for more information on using variable-length argument
lists to specify resources.
See Also
XtAppInitialize(1), XtVaSetValues(1).
Xt - Initialization XtVaAppInitialize()