command-line-arguments

Installing a new SQL Server instance fails

I've previously in my setup installed SQL Server Express 2005. Now I've switched to SQL Server Express 2008. I updated the command line parameters to those documented for the latter. If the comp already has SQL Server Express 2008 installed, my installer should create a new instance. The command line parameters are as follows: /ACTION=...

Pass in a value into Python Class through command line

Hello, I have got some code to pass in a variable into a script from the command line. I can pass any value into function for the var arg. The problem is that when I put function into a class the variable doesn't get read into function. The script is: import sys, os def function(var): print var class function_call(object): def...

Convert c++ argument to int

Hello, I have a small c++ program that needs to get and argument and convert it to an int. Here is my code so far: #include <iostream> using namespace std; int main(int argc,int argvx[]) { int i=1; int answer = 23; int temp; // decode arguments if(argc < 2) { printf("You must provide at least one argument...

Passing additional variables from command line to make

How to pass variables to gnu makefile from command line arguments? In other words I want to pass some arguments which will eventually become variables in makefile. ...

Processing command-line arguments in prefix notation in Python

I'm trying to parse a command-line in Python which looks like the following: $ ./command -o option1 arg1 -o option2 arg2 arg3 In other words, the command takes an unlimited number of arguments, and each argument may optionally be preceded with an -o option, which relates specifically to that argument. I think this is called a "prefix ...

Structs, strtok, segmentation fault

I'm trying to make a program with structs and files. The following is just a part of my code(it;s not the entire program). What i'm trying to do is: ask the user to write his command. eg. delete John eg. enter John James 5000 ipad purchase. The problem is that I want to split the command in order to save its 'args' for a struct element...

Mac OS X: Getting detailed process information (specifically its launch arguments) for arbitrary running applications using its PID.

I am trying to detect when particular applications are launched. Currently I am using NSWorkspace, registering for the "did launch application" notification. I also use the runningApplications method to get apps that are currently running when my app starts. For most apps, the name of the app bundle is enough. I have a plist of "known ...

symbols in command line argument.. python, bash

Hi, I am writing a python script on Linux for twitter post using API, Is it possible to pass symbols like "(" ")" etc in clear text without apostrophes.... % ./twitterupdate this is me #works fine % ./twitterupdate this is bad :(( #this leaves a error on bash. Is the only alternative is to enclose the text into --> "" ?? like.. % ...

bash tools for parsing arguments

I have a bash script that uses a few variables (call them $foo and $bar). Right now the script defines them at the top with hard coded values like this: foo=fooDefault bar=barDefault .... # use $foo and $bar What I want is to be able to use the script like any of these: myscript # use all defaults myscript -foo=altFoo ...

How to receive an argument in console program?

So I want other users to be able to run my programm sending arguments. how to do such thing? ...

First parameter of os.exec*

From the python docs: The various exec*() functions take a list of arguments for the new program loaded into the process. In each case, the first of these arguments is passed to the new program as its own name rather than as an argument a user may have typed on a command line. For the C programmer, this is the argv[0] ...

Find the "name" of a library (-L -l switches)

Being fairly new to C++ I have a question bascially concerning the g++ compiler and especially the inclusion of libraries. Consider the following makefile: CPPFLAGS= -I libraries/boost_1_43_0-bin/include/ -I libraries/jpeg-8b-bin/include/ LDLIBS= libraries/jpeg-8b-bin/lib/libjpeg.a # LDLIBS= -L libraries/jpeg-8b-bin/lib -llibjpeg all: ...

Why does sh/bash set command line parameter values when trying to set environment variable?

A question on basics : While tuning environment variables for a program launched from a script, I ended up with somewhat strange behaviour with sh (which seems to be actually linked to bash) : variable setting seems to mess up with command-line parameters. Could somebody explain why does this happen? A simple script: #! /bin/sh # Mes...

How can I manage command line arguments/variables for a script written in Perl?

I am trying to manage numerous arguments that are specified by a user when they execute a command. So far, I have been trying to limit my script design to manage arguments as flags that I can easily manage with Getopt::Long as follows: GetOptions ("a" => \$a, "b" => \$b); In this way I can check to see if a or b were specified and the...

How to access original command-line argument string in Ruby?

I'm trying to access the original command line argument string in Ruby (ie - not using the pre-split/separated ARGV array). Does anyone know how to do this? For example: $> ruby test.rb command "line" arguments I want to be able to tell if 'line' had quotes around it: "command \"line\" arguments" Any tips? Thanks in advance ...

Command Line argument option not working on Visual C++ 2008

Hello, I am trying to pass command line parameters in Debug mode in one VC++ 2008 solution as described here Debugging with command-line parameters in Visual Studio. The thing is that somehow actually VC++ is not passing the parameteres because I always get 1 for "argc" variable. Is anything else that should be enabled or what could pre...

batch files command line arguments

hi i am setting a string in a variable set main=svn commit -m "Build version number update" install\msbuild\VersionNumber.txt and passing "%main%" as a command line argument to another script template.bat . but in template.bat "Build version number update" is cosidered a 2nd arg and rest as 3rd one. please tell me how to pass the ...

how to debug VC++ program, input file not open while debuging

i am using Visual studio 8. i pass command line argument to my program when i execute the program using exe file it works fine but when i use to debugg. it is unable to open the input file which i have given it in the form of command line argument. although i have given the command line argument in the Project->properties->debug->command...

What the difference between "$@" and "$*" in bash ?

Hello All, It seems to me that they both store all the command-line argument. So is there a difference between this two ? Thanks ...

C# and T-SQL command-line Utility

Group, Part 1: I'm currently working on a command line utility that can take args and update a local database. The only issue I have is once i established a "Data connection"..how can I use those args for queries and searches. For example: ~//arrInput.exe "parm1" "pram2" "pram3" Part 2: I would like to take in command line args and ...