command-line

How do I start a command from terminal so that terminal is not the parent?

Let's take example of a command "example-command". I open terminal I write example-command in terminal, and example-command executes. Now if I close terminal, example-command gets killed too. I now try with "example-command &", but the same behaviour. How do I execute a command so that when I close the terminal, the command doesn't g...

Getting the current ip address from within a application (VC++ 2005)

Hi, I would like to send an email from an application that contains the current ip address of the machine. I have the email code in place and it works. I just need to add the ipaddress to the body of the email (ie I am not doing anything programmatically with the IP address). I was hoping there was a really simple way like running ipc...

Finding binary chunk in a file

I have a chunk of fairly random binary data. I want to find where that chunk exists in a file, how many times it occurs, and at what byte (or sector) offsets. Any ideas on how to do that? Thanks, Justin ...

How do I write some (bash) shell script to convert all matching filenames in directory to command-line options?

Apparently the answer to my question "Can I restrict nose coverage output to directory (rather than package)?" is no, but I can pass a --coverage-package=PACKAGE option to nose with the package name of each .py file in the directory. So for example, if the directory contains: foo.py bar.py baz.py ...then I would need to use the comma...

Mac OS X New Users From Command Line

I need to add a new user via the command line in single-user mode. I reinstalled OS X earlier, and for some reason, it didn't create my user account properly. Now I can't log in. So I'm wondering how exactly I can go about creating a new user account without reinstalling everything. I tried this, but it didn't work: http://osxdaily.c...

Javascript for command line utilities

Given a need to write command line utilities to do common tasks like uploading files to a remote FTP site, downloading data from a remote MySQL database etc. Is it practical to use JavaScript for this sort of thing? I know there are JavaScript interpreters that can be run from the command line, but are there libraries for things like F...

Copy a directory tree to a single directory at a command line

Anyone know of a command line utility (or one that can run as a command line) that will collect all the .jpg files in a directory tree to a single folder, only copying files that change? I started with Renamer, which is great for renaming files in their current directories, but fell short when I tried to mangle the path. This is probab...

Windows Batch file debugger?

Is there a program like Visual Studio that allows you to debug (dos) batch files? What techniques could I use to debug? Martin Brown answered a batch file question with a nice for / each loop. I would love to see the values of the variables as they loop. for /R A %i IN (*.jpg) DO xcopy %i B /M ...

What is the closest thing to grep that comes standard on a Windows install?

I'd like to do something like "dsquery * | grep asdf" on a Windows machine that I can't install anything on. Any ideas? Thank you. ...

Parse Command Line Arguments

Duplicate of: What parameter parser libraries are there for C++? Option Parsers for c/c++? What is the best way of parsing command-line arguments in C++ if the program is specified to be run like this: prog [-abc] [input [output]] Is there a library in STL to do this? Related: Parsing command line arguments in a unicode C+...

Print fifo content and exit

I need to print the content of a fifo (named pipe) to standard output. I could use the command: cat fifo The problem is that cat doesn't return. It stays running, waiting for more content coming from the fifo. But I know there wont be any more content coming for a while so I just want to print what's available. Is there a command tha...

SVN command line dialogs

How do you suppress the annoying dialogs from the command line? I'm using windows 7 (WMWare), latest command line client from collab.net, I'm getting a simple confirmation dialog when I issue a checkout command. nothing to do but hit OK, however i'd rather not be asked. ...

Are there any command line TMX editing tools (multilanguage support) for Linux ?

I'm building an application with multilanguage support in TMX. I've found some editors for windows, but since I'm developing on a remote server, I'm looking for a command line tool for linux to translate strings and write them to a TMX file. Does anyone know of such tools ? ...

Parse quoted text from within batch file

I would like to do some simple parsing within a batch file. Given the input line: Foo: Lorem Ipsum 'The quick brown fox' Bar I want to extract the quoted part (without quotes): The quick brown fox Using only the standard command-line tools available on Windows XP. (I had a look at find and findstr but they don't seem quite flexib...

Check that an svn repository url does not exist

This should be a really simple question but somehow I cannot find the answer to it. My apologies if I have missed something blindingly obvious. I am writing a script which will add a new project in the repository, based on the name supplied by the user. Part of this involves checking that an url with the same name does not already exist...

[Linux command] How to move a directory

Hi. my old and new directory have same folders and files inside. I try "mv -if old/* new/" and get error mv: cannot move `./xxxxxx' to a subdirectory of itself How can I move it ? (Centos 5) thanks. ...

Command line parser for Qt4

I am looking for a command line parser for Qt4. I did a small google search, and found this: http://www.froglogic.com/pg?id=PublicationsFreeware&category=getopt however it lacks support for "--enable-foo" and "--disable-foo" switches. Besides that, it looks like a real winner. EDIT: It seems Frologic removed this. So the best opt...

How do I display progress bars from a shell command over ssh.

I've got a script thats supposed to mimic ffmpeg on my local machine, by sending the command of to a remote machine, running it there and then returning the results. (see previous stack*overflow*** question.) #!/usr/bin/env ruby require 'rubygems' require 'net/ssh' require 'net/sftp' require 'highline/import' file = ARGV[ ARGV.index(...

command line to get the memory used by process

What command line should I write to display the memory used by process as well as the process command line and it's pid ? Something like: pid mem cmdline --- --- ------- 112 12M mysql -param1 5 -param2 12 115 15M apache -param1 44 -param2 8 ... ...

Problem parsing commandline arguments containing '&' character in C#.Net

I am working in VisualStudio 2008 environment and developing a commandline application in C#.Net. The application expects a path to be passed from the commandline argument. I am passing these arguments to the to my application by setting the "Command line arguments" in the debug option of the project setting. The argument I provided is -...