Ubuntu :: Passing Arguments In Commandline

Mar 13, 2011

I have some source code of an application called gmapping.

I am pasting the source code documentation below:

SCANMATCHER:

How do I run this file. When I enter the filename parameter, and press enter, I get

COMMAND LINE: parameter aces not recognized no filename specified

GridFastSlam: Initialization Error!

(Did you specified an input file for reading?)

What is the right line to type in the terminal to sun this code?

View 1 Replies


ADVERTISEMENT

General :: Passing Program Arguments To Gdb?

Nov 18, 2009

I'm using gdb to debug my program. My program requires arguments (e.g., ./prog -dfile).But if I use gdb as in gdb ./prog -dfile, gdb wants to interpret the -d argument. How do I pass an argument to my program via gdb?

View 2 Replies View Related

Ubuntu :: Incrontab Not Passing Arguments To Bash Script

Feb 28, 2010

It seems incrontab wont see spaces properly at all. I setup a script to echo the arguments passed to it by incrontab to a file, and no matter what I put around the arguments on the incrontab file it will count a space as the next argument.

I have written a script to automatically retrieve imdb artwork for a given filename. Here is the script:

Code:

You can ignore all the commented "echo" commands that was just me testing. Anyway, the script work fine, however I am trying to use incrontab to monitor a folder, when a new (video) file is moved into the folder, it should execute the script and retrieve the artwork. My problem is, when incrontab passes the $# argument to my script, the script wont work because the spaces aren't escaped.

Here is some more detail:

Incrontab

Code:

Code:

The problem is, the script GetArtwork, doesn't see "Bangcock Dangerous" it just sees "Bangcock"

I have tried putting quotes around the $# in the incrontab - this just makes the script see "Bangcock (notice the single quote character)

View 2 Replies View Related

Programming :: Passing Arguments To A Child Process In C++?

Feb 7, 2010

what I am trying to do is to pass an argument to the standard input stream of a child process. I mean I create two programs .. first one invokes the other. second one contains something like

Code:

scanf("%d", &n);

now I want my first program to be able to pass a value to the second one so that it gets stored in n.

View 7 Replies View Related

Programming :: Passing Arguments To System Command?

Dec 17, 2009

I am calling another executable in my application (C programing) using "system" command
which is user interactive program. now i want to pass those args in system command only.

system(" executable ");

Executable will expect 1,2 or 3.

1 is to continue
2 for do changes in settings
3 exit from application

how to pass these in to system command

View 1 Replies View Related

Programming :: Syntax For Passing Arguments In Csh Aliases?

Mar 22, 2009

I want to write a little time-saving alias for my .cshrc file that will move files and then cd to the directory I've moved them to. What I can't quite figure out is the syntax to say 'move all the arguments except the last one.' Here is what I have:

alias follow 'mv !:1-$-1 !:$; cd !:$'

This actually seems to work, but it also gives me an irritating error:

mv: cannot stat `destinationdirectory/-1': No such file or directory

Similarly, I tried:

alias follow 'mv !:*$#argv-1 !:$; cd !:$'

Again the move and cd are successful, but again there is an error:

mv: cannot stat `destinationdirectory/0-1': No such file or directory

View 1 Replies View Related

Programming :: Passing Arguments To A Bash Source File?

Apr 24, 2010

Is it possible to pass arguments to a source file in a bash script? For example

#!/bin/sh
#
. /dir1/dir1/funclib -a -b

How would you check for the passed arguments in funclib without getting confused with any arguments passed to the main script?

View 5 Replies View Related

General :: Passing An Array As Command Line Arguments?

Apr 2, 2011

how to pass an array as a command line argument in a shell script?

View 5 Replies View Related

General :: Passing Multiple Arguments In Shell Script?

Dec 11, 2010

The script receives multiple files as parameters and it is supposed to count the number of lines in each of them and write that number in another file.

This is my script:

Code:

while [ -n "$1" ]
do
lines=`cat $1 | wc -l`
echo "The number of lines in file $1 is $lines." >> lines.txt
shift
done

Is there any other way to do the same thing, without using shift?

View 7 Replies View Related

Programming :: C Syntax - Passing In Unknown Number Of Arguments?

May 18, 2009

I need to write a wrapper function around the mvprintw function, like so:

int smvprintw( ? )
{
// Do various checks/modifications on the first two arguments (int y,
int x) first,
// and then
return mvprintw ( ? );
}

How should I write the args for smvprintw so that I can pass all the data correctly to mvprintw, and also do my checks on the first two args (for example, to modify them)? I'm confused by the prototype of mvprintw: This is mvprintw as listed in the man pages:

int mvprintw(int y, int x, const char *fmt, ...);

And this is how I saw it in ncurses.h:

extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...)

I believe the "..." refers to the unknown number of items after const char * fmt. Will it suffice to do something like "int smvprintw(int y, int x, const char * fmt, void * etc)" and then "mvprintw(y, x, fmt, etc)" inside the function?

View 2 Replies View Related

Programming :: Case Statement Passing Multiple Arguments?

Aug 7, 2010

I've started dabbling with the case statement in order to pass some option's arguments into variables. I do not think I am doing this right.

Code:

usage() {
echo "Usage: $0 [-z|--snooze] [-c|--channel] [-p|--playlist]
[-m|--message] [-v|--mpcvolume]"

[code]....

As you can see, I want to pass arguments depending on the option(s) chosen by the user; ie. --snooze, or --channel. By default, if no options are chosen, I'll display a usage message; though in the future I'll provide some sane defaults. I'd like to create a case statement to handle passing arguments to any number of options; something like:

Code:

wakethehellup.sh --snooze 20 --message 'wake up!'

and for the other arguments, it would have a default set. The case statement I provided fails with a syntax error "syntax error near unexpected token `$2'" near the '--snooze' in the statement, so I take it you can't pass a parameter in this way; but I'm confused as to how I'm supposed to pass different parameters to different options without the options being confused as parameters.

View 2 Replies View Related

General :: Scripting - Try To Passing Arguments To For Cycle - Inside A Function

Apr 26, 2011

The code:

Quote:

Problem: I need a method to maintain the $i variable. In fact, actually, this variable get lost when executed. I think that an escape can preserve this variable and permit its execution inside the function, but I've no idea about.

View 3 Replies View Related

General :: Passing Commands As Arguments To Functions In Bash Script?

May 31, 2010

I wrote a simple bash script to let me treat any set of programs like a deamon. For example if I configure the script a certain way I can start/stop/get the status of apache, mysql and php all from one command. I am having a bit of a problem though. I am passing commands as strings to a function and then depending on the arguments to the script it might run one of these commands or another. Some of these commands need to beun in the background though, such as deluge-web. When I send "deluge-web &" to the function and it execute it deluge-web does not start in the background. I can't figure out why this is. I have tried escaping the & with ''s and with a , but nothing seems to work. I know that this is some idiotic thing that I am overlooking, but I am a bit stumped. Here is the script configured to start/stop/get status of deluged and deluge-web.

Code:
#!/bin/bash
function checkanddosomething {

[code]...

View 3 Replies View Related

Programming :: Passing Command-line Arguments To Qglviewer Application?

Jul 13, 2009

how to use QGLviewer. I want to give my program a file name as a command line argument. All of the sample programs I find have a main.cpp file like this:

Quote:

#include <QApplication>
#include "window.h"
int main(int argc, char *argv[])

[code]....

Then the Window class, which is derived from QGLViewer, does all the program's actual work. If I want access to argc and argv, for example, to open and read a file that's passed as an argument, what would handle that? Is there a built-in way to get the arg variables to the window class, or do I need to just write a loadfile function and pass them?

View 1 Replies View Related

Ubuntu :: Parsing Textfiles And Passing Arguments In Bash To Preserve Tracker-tag Metadata

Sep 3, 2010

I'm at the bottom of the bash learning curve, looking up, hoping someone can toss me a line. I need to update tracker on my system but this will erase the metatag database I've been building up over the course of months for the purpose of indexing a news archive. So the solution seems to be, 1) save the output of tracker-tag to a text file for all relevant files within a directory, 2) upgrade tracker (since the version in the Ubuntu repositories is very much out of date) and then 3) use a script to parse the text file and pass appropriate arguments back to tracker-tag to rebuild the database. It sounds as though it ought to be simple enough, but I need a push in the right direction, which hopefully will not be off the cliff. Before I confuse my metaphors any further, here's what the text file looks like.

[Code]....

View 3 Replies View Related

Ubuntu Installation :: Upgrade From 8.10 To 9.04 In Commandline?

Mar 1, 2010

Is there a way to upgrade from 8.10 to 9.04 in commandline?

View 4 Replies View Related

Ubuntu Multimedia :: Video Cutter With Commandline?

Feb 19, 2010

I m looking for a video cutter that cut a portion of video in the given format, i tried ffmpeg and avidemux but they touch( some modification) the original video so output doesn't remains same as the source is there any software for ubuntu 8.04 hardy which cuts the video portion as it is and have command line support

View 9 Replies View Related

Ubuntu Networking :: Configure Wireless From Commandline?

Mar 9, 2010

How can we configure a wireless network from commandline in Ubuntu?

I understand iwlist will give us the list of access points.

Next using iwconfig it is possible to connect to a wireless network without network manager. connect to a wireless network using commandline?

View 4 Replies View Related

Ubuntu :: List Of Installed Packages By Repository Through Commandline?

Feb 11, 2011

I know dpgk --get-selections will list all installed packages, but is there a way to also get the repository each belongs to as well.

View 3 Replies View Related

General :: How To Know Hardware RAID Through Commandline

Feb 25, 2010

I have configured Hardware RAID. Is there any way I can know that through login to linux box?

View 6 Replies View Related

General :: How To Send Webmail From Commandline

Jan 21, 2011

I am writing a script in which I need to send a email to a @vtext.com address and was confused on how to go about this. (Its in a perl script so ideally it would be a one line command so I can just put in back ticks).

View 1 Replies View Related

Software :: Gphoto2 Commandline Client

Feb 27, 2011

I'm making a script for making tethered shooting easier in linux. With that I'm using gphoto2.

But i want to display the battery status:

in commandline it is:

As a result I get:

Label: Battery Level
Type: TEXT
Current: 100%

Now I only want to display the percentage, is this possible?

View 2 Replies View Related

Slackware :: How To Clear Commandline History

Mar 7, 2010

How would I clear my commandline history at logon/logoff/startup time? I tried this : editing my /etc/rc.d/rc.local file like this I know this is for system startup

Code:
#!/bin/sh
# /etc/rc.d/rc.local: Local system initialization script.
# Put any local startup commands in here.

Also, if you have anything that needs to be run at shutdown time you can make an /etc/rc.d/rc.local_shutdown script and put those commands in there.

#clear user history ~/.bash_history
echo "" > ~/.bash_history
#clear root history /root/.bash_history
echo "" > /root/.bash_history

But when I reboot, the history still remains.

View 2 Replies View Related

Debian Multimedia :: Use Commandline Audioplayer For Which Purpose?

Nov 17, 2010

Any commandline audioplayer I might not have heard before? Which one do you use? I just started using Moc [URL]

View 12 Replies View Related

Fedora :: How To Delete Folders With Stuff In Commandline?

Dec 21, 2010

I want to delete a folder with stuff in it through command line. I tired rm and rmdir but it doesn't seem to be working.

View 3 Replies View Related

OpenSUSE Install :: Get A GUI Desktop From The Commandline Screen?

Mar 10, 2011

I just upgraded to OpenSuse 1.4 from 1.1 and it boots straight to the command lines. After login I type startx and it still does not go to the KDE desktop or anywhere else fo that matter. how to get to a GUI desktop from the commandline screen?

View 1 Replies View Related

General :: Manually Closing A Port From Commandline?

Apr 6, 2010

I want to close an open port which is in listening mode between my client and server application. Is there any manual command line option in Linux to close a port ??NOTE: I came to know that "only the application which owns the connected socket should close it, which will happen when the application terminates."I dont understand why it is only possible by the application which opens it ... But still eager to know if there is any another way to do it ??

View 4 Replies View Related

General :: FTP Commandline Script To Send Files

Mar 1, 2011

I use in Ubuntu proftpd to send files with a little script over the internet to my website.
If I write all these scripts it's a lot of work and my first question is what is the best way to send files over.

For example do you need to type:
put /directory/file.gz /www/file.gz ? or can it shorter? like
put /directory/file.gz /www/ because then ftp complains it can't create file

View 1 Replies View Related

Server :: Commandline Monitoring Tool For Mysql?

May 2, 2011

I'm looking for commandline monitoring tool for mysql and only thing I can find is mtop. Unfortunately, mtop's development halted back in 2004. Can someone suggest an alternative? or is there such thing?

View 2 Replies View Related

Software :: KeePass 2 Ignores Commandline Argument?

Jul 2, 2011

I run the password manager KeePass2 with the following starter:

Code:
mono /opt/keepass2-mono/KeePass.exe /home/XXXXXXX/KeePass.kdbx

While the program runs fine, it does not select the database automatically (last argument). This used to work with KeePassX. Nor does KeePass2 remember the recently opened files (the menu remains empty).

My system: Ubuntu Natty 32bit, KeePass 2.15

PS: I have to use KeePass2 as I need to share the database with other OS where KeePass1 is not supported. And would love to see ported KeePass2 to linux without mono. Keepass2 also looks worse than KeePassX IMO.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved